RKE2 Cluster v1.32 to v1.33 Upgrade

In this article I will show you how to upgrade the RKE2 Cluster from v1.32 to v1.33 using Rancher. Rancher transforms complex Kubernetes operations into simple point-and-click actions. Instead of manually upgrading each cluster node with SSH and command-line tools, Rancher's web interface lets you orchestrate entire cluster upgrades with just a few clicks from your browser. Keeping RKE2 Cluster current ensures you have the latest features, security patches, and bug fixes.

So, let's get started…

Environment

  • RKE2 Cluster and Rancher Manager
Hostnameat-rke2-1 (master node)
Operating SystemUbuntu 22.04 (Jammy)
vCPU8 (too large for testing)
Memory12 GB (too large for testing)
Disk60 GB
Network172.20.20.65
Hostnameat-rke2-2 (worker node)
Operating SystemUbuntu 22.04 (Jammy)
vCPU4
Memory8 GB
Disk40 GB
Network172.20.20.66
Hostnameat-rke2-3 (ingress node)
Operating SystemUbuntu 22.04 (Jammy)
vCPU2
Memory4 GB
Disk30 GB
Network172.20.20.67

RKE2 Cluster Upgrade

  1. Make sure domain mapping
# exec on all nodes
cat /etc/hosts
---
172.20.20.65 at-rke2-1 at-rke2-1.at.lab rancher.at.lab
172.20.20.66 at-rke2-2 at-rke2-2.at.lab
172.20.20.67 at-rke2-3 at-rke2-3.at.lab
  1. Create sample apps
# exec on master node
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
kubectl create deployment nginx-upgrade --image=nginx --replicas=2
kubectl expose deployment nginx-upgrade --port=80 --target-port=80 
kubectl create ingress nginx-upgrade --class=nginx --rule="nginx-upgrade.at.lab/*=nginx-upgrade:80"

nano /etc/hosts
---
172.20.20.67 nginx-upgrade.at.lab
  1. Create script for monitoring apps
# exec on master node
nano monitoring.sh
---
#!/bin/bash

# List of URLs to check
URLS=(
  "http://nginx-upgrade.at.lab"
)

EXPECTED_STATUS=200  # expected HTTP status
INTERVAL=1           # seconds between checks

echo "📡 Starting Ingress monitoring..."
echo "Expected status: $EXPECTED_STATUS"
echo "Check interval: $INTERVAL seconds"
echo "Press Ctrl+C to stop."

while true; do

    for url in "${URLS[@]}"; do
        STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$url")

        if [ "$STATUS_CODE" -eq "$EXPECTED_STATUS" ]; then
            echo "✅ $(date '+%Y-%m-%d %H:%M:%S') - $url is OK (HTTP $STATUS_CODE)"
        else
            echo "❌ $(date '+%Y-%m-%d %H:%M:%S') - $url returned HTTP $STATUS_CODE"
        fi
    done

    sleep $INTERVAL
done

chmod +x monitoring.sh
  1. Run monitoring script
# exec on master node
./monitoring.sh >> monitoring.log

# other panel/windows
tail -f monitoring.log
kubectl get po -A --watch
  1. Upgrade cluster via rancher

upgrade process

upgrade completed

  1. Verification

  1. Operational test
# exec on master node
nano /etc/hosts
---
172.20.20.65 #rancher.at.lab
172.20.20.67 rancher.at.lab

source ~/.bashrc
kubectx
kubectx rke2-cluster
# exec on master node
kubectl create deployment nginx-aft-upgrade --image=nginx --replicas=1
kubectl expose deployment nginx-aft-upgrade --port=80 --target-port=80 
kubectl create ingress nginx-aft-upgrade --class=nginx --rule="nginx-aft-upgrade.at.lab/*=nginx-aft-upgrade:80"

nano /etc/hosts
---
172.20.20.67 nginx-aft-upgrade.at.lab

Thank You.

0
Subscribe to my newsletter

Read articles from Muhammad Alfian Tirta Kusuma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Muhammad Alfian Tirta Kusuma
Muhammad Alfian Tirta Kusuma