Feedback

Chat Icon

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Understanding How K3s and RKE2 Work
18%

Installing and Configuring RKE2

The first cluster is up and running. We are going to create the second cluster using RKE2 and use Rancher to manage it. Start by SSHing into the control plane node.

ssh root@$WORKLOAD_CONTROLPLANE_01_PUBLIC_IP

The first step is to install RKE2 on the control plane node.

# install rke2
curl -sfL https://get.rke2.io | \
    INSTALL_RKE2_TYPE=server \
    INSTALL_RKE2_CHANNEL="stable" \
    RKE2_VERSION="v1.34.1+rke2r1" \
    sh -

Set the token for the server.

# we can set the token - create config dir/file
mkdir -p /etc/rancher/rke2/
echo "token: p@ssword" > /etc/rancher/rke2/config.yaml

This token will be used to join the worker nodes to the cluster. You can change it to a more secure jumble of characters. For example, you can run openssl rand -base64 32 | tr -d '[:punct:]' to get a random string. It's important to reuse the same token when adding more nodes to the cluster later.

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Enroll now to unlock all content and receive all future updates for free.