diff --git a/asciidoc/guides/metallb-kube-api.adoc b/asciidoc/guides/metallb-kube-api.adoc index 8ffa66ed..242066e0 100644 --- a/asciidoc/guides/metallb-kube-api.adoc +++ b/asciidoc/guides/metallb-kube-api.adoc @@ -40,17 +40,25 @@ SSH to the first host and install the wanted distribution in cluster mode. For RKE2: [,bash] ---- -# Export the free IP mentioned above -export VIP_SERVICE_IP= +# 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 +# An example of the config.yaml file for a server node: +write-kubeconfig-mode: "0644" +tls-san: + - "${VIP_SERVICE_IP}" + - "https://${VIP_SERVICE_IP}.sslip.io" +EOF + +# Install RKE2 +curl -sfL https://get.rke2.io | INSTALL_RKE2_EXEC="server" sh - -curl -sfL https://get.rke2.io | INSTALL_RKE2_EXEC="server \ - --write-kubeconfig-mode=644 --tls-san=${VIP_SERVICE_IP} \ - --tls-san=https://${VIP_SERVICE_IP}.sslip.io" sh - - +# Enable and start the RKE2 service with the configuration specified in the config.yaml file systemctl enable rke2-server.service systemctl start rke2-server.service -# Fetch the cluster token: +# Fetch the cluster token to be used later: RKE2_TOKEN=$(tr -d '\n' < /var/lib/rancher/rke2/server/node-token) ----