File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,25 @@ SSH to the first host and install the wanted distribution in cluster mode.
4040For RKE2:
4141[,bash]
4242----
43- # Export the free IP mentioned above
44- export VIP_SERVICE_IP=<ip>
43+ # As a root user, create the /etc/rancher/rke2/config.yaml config file with the following content:
44+
45+ mkdir -p /etc/rancher/rke2/
46+ cat << EOF > /etc/rancher/rke2/config.yaml
47+ # An example of the config.yaml file for a server node:
48+ write-kubeconfig-mode: "0644"
49+ tls-san:
50+ - "${VIP_SERVICE_IP}"
51+ - "https://${VIP_SERVICE_IP}.sslip.io"
52+ EOF
4553
46- curl -sfL https://get.rke2.io | INSTALL_RKE2_EXEC="server \
47- --write-kubeconfig-mode=644 --tls-san=${VIP_SERVICE_IP} \
48- --tls-san=https://${VIP_SERVICE_IP}.sslip.io" sh -
49-
54+ # Install RKE2
55+ curl -sfL https://get.rke2.io | INSTALL_RKE2_EXEC="server" sh -
56+
57+ # Enable and start the RKE2 service with the configuration specified in the config.yaml file
5058systemctl enable rke2-server.service
5159systemctl start rke2-server.service
5260
53- # Fetch the cluster token:
61+ # Fetch the cluster token to be used later :
5462RKE2_TOKEN=$(tr -d '\n' < /var/lib/rancher/rke2/server/node-token)
5563----
5664
You can’t perform that action at this time.
0 commit comments