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