diff --git a/asciidoc/guides/metallb-kube-api.adoc b/asciidoc/guides/metallb-kube-api.adoc index 517f0914..ba5eceb8 100644 --- a/asciidoc/guides/metallb-kube-api.adoc +++ b/asciidoc/guides/metallb-kube-api.adoc @@ -289,21 +289,29 @@ Now execute the commands below on the second and third nodes. For RKE2: [,bash] ---- -# Export the VIP_SERVICE_IP in the VM -# Replace with the actual IP -export VIP_SERVICE_IP= - -curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="server" sh - -systemctl enable rke2-server.service - +# As a root user, create the /etc/rancher/rke2/config.yaml config file with the following content: mkdir -p /etc/rancher/rke2/ -cat < /etc/rancher/rke2/config.yaml +cat << EOF > /etc/rancher/rke2/config.yaml +# An example of the config.yaml file for an agent node: server: https://${VIP_SERVICE_IP}:9345 +write-kubeconfig-mode: "0644" +tls-san: + - "${VIP_SERVICE_IP}" + - "https://${VIP_SERVICE_IP}.sslip.io" +# The one from above token: ${RKE2_TOKEN} EOF -systemctl start rke2-server.service +# Install RKE2 +curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="server" sh - + +# Enable the RKE2 service with the configuration specified in the config.yaml file + +systemctl enable --now rke2-server.service + +# Fetch the cluster token to be used later: +RKE2_TOKEN=$(tr -d '\n' < /var/lib/rancher/rke2/server/node-token) ---- For K3s: