File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -289,21 +289,29 @@ Now execute the commands below on the second and third nodes.
289289For RKE2:
290290[,bash]
291291----
292- # Export the VIP_SERVICE_IP in the VM
293- # Replace with the actual IP
294- export VIP_SERVICE_IP=<ip>
295-
296- curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="server" sh -
297- systemctl enable rke2-server.service
298-
292+ # As a root user, create the /etc/rancher/rke2/config.yaml config file with the following content:
299293
300294mkdir -p /etc/rancher/rke2/
301- cat <<EOF > /etc/rancher/rke2/config.yaml
295+ cat << EOF > /etc/rancher/rke2/config.yaml
296+ # An example of the config.yaml file for an agent node:
302297server: https://${VIP_SERVICE_IP}:9345
298+ write-kubeconfig-mode: "0644"
299+ tls-san:
300+ - "${VIP_SERVICE_IP}"
301+ - "https://${VIP_SERVICE_IP}.sslip.io"
302+ # The one from above
303303token: ${RKE2_TOKEN}
304304EOF
305305
306- systemctl start rke2-server.service
306+ # Install RKE2
307+ curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="server" sh -
308+
309+ # Enable the RKE2 service with the configuration specified in the config.yaml file
310+
311+ systemctl enable --now rke2-server.service
312+
313+ # Fetch the cluster token to be used later:
314+ RKE2_TOKEN=$(tr -d '\n' < /var/lib/rancher/rke2/server/node-token)
307315----
308316
309317For K3s:
You can’t perform that action at this time.
0 commit comments