Skip to content

Commit 2096fe3

Browse files
ranjinimne-minguez
andauthored
Cherry-pick-3.2-620-Adding control-plane nodes" - Requires tls-sans to be set for LB (#955)
* Edited content based on the information in the issue (#947) Signed-off-by: Ranjini M N <ranjini.n@suse.com> * Updated EOF Co-authored-by: Eduardo Mínguez <e.minguez@gmail.com> --------- Signed-off-by: Ranjini M N <ranjini.n@suse.com> Co-authored-by: Eduardo Mínguez <e.minguez@gmail.com>
1 parent 949d1bc commit 2096fe3

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

asciidoc/guides/metallb-kube-api.adoc

Lines changed: 16 additions & 8 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/
300294
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)