Skip to content

Commit 4cd0602

Browse files
authored
Edited content based on the information in the issue (#947)
Signed-off-by: Ranjini M N <[email protected]>
1 parent 462415b commit 4cd0602

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

asciidoc/guides/metallb-kube-api.adoc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,29 @@ Now execute the commands below on the second and third nodes.
289289
For 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
300294
mkdir -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:
302297
server: 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
303303
token: ${RKE2_TOKEN}
304304
EOF
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

309317
For K3s:

0 commit comments

Comments
 (0)