Skip to content

Commit 40b6ec7

Browse files
committed
Edited content based on the information in the issue (suse-edge#947)
Signed-off-by: Ranjini M N <ranjini.n@suse.com>
1 parent 2251012 commit 40b6ec7

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
@@ -288,21 +288,29 @@ Now execute the commands below on the second and third nodes.
288288
For 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
299293
mkdir -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:
301296
server: 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
302302
token: ${RKE2_TOKEN}
303303
EOF
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

308316
For K3s:

0 commit comments

Comments
 (0)