Fuzzball Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Installing RKE2 on the Server Node

After the initial configuration has been completed, you are ready to install RKE2.

The RKE2 quick start guide suggests using a curl | sh approach to download and run the appropriate script for installation.

It is usually considered a bad practice to perform a curl | sh since you never can be completely sure of the code you are running. A bad actor could compromise the server hosting the URL and change the script. You may want to download and inspect the script before running it.

The following script will set up a YUM repository and installsRKE2 with compatible OS packages.

# curl -sfL https://get.rke2.io | sh -

Nodes that have more than one IP address should specify explicitly which IP address to use prior to starting the server. You can determine which IP address you want to use to host the server with ip addr or similar.

# INTERNAL_IP_ADDR="" # set this value to the server internal IP address you want to use (e.g. 10.0.0.3)

# echo "node-ip: ${INTERNAL_IP_ADDR}" >/etc/rancher/rke2/config.yaml

Be aware of the following issue from the RKE2 GitHub repo.

“Servers must have static IP addresses. If you must change the address, you should delete the node from the cluster and re-add it with the new address. In the case of a single-node cluster, you can stop the rke2-server service, run rke2 server –cluster-reset to reset the etcd cluster membership back to a single member with the current node IP address, then start the rke2-server service again.”

With the local configuration in place, you are ready to start your RKE2 server.

# systemctl enable --now rke2-server.service

Once you have started the service, you can use kubectl to monitor the progress of pods as they are initialized.

# export PATH=/var/lib/rancher/rke2/bin:$PATH

# export KUBECONFIG=/etc/rancher/rke2/rke2.yaml

# kubectl get pods -A

The updated PATH and KUBECONFIG variables are necessary for the kubectl command to operate properly and should therefore be added to your ~/.bashrc or otherwise set automatically.

When all pods are either “Completed” or “Running” your basic RKE2 cluster is ready to go!