Video Thumbnail for Lesson
13.1: Cluster/Node Upgrade Procedure

Upgrading Clusters and Nodes

Keeping your Kubernetes cluster updated ensures you receive security patches and can use the latest features. Below is a common approach to upgrade both the control plane and the worker nodes.

1. Check for Deprecated APIs

Before upgrading, verify that none of your deployed resources rely on API versions that will be removed in your target Kubernetes version. The kubent tool scans your cluster and warns about deprecated APIs.

# run the check
kubent

If the tool reports deprecated API usage, update those manifests first.

2. Update the Control Plane

Kubernetes allows the control plane to be ahead of the worker nodes by up to two minor versions. Upgrade it first using your cloud provider's CLI. In Google Kubernetes Engine (GKE) you can select the rapid release channel and upgrade to a specific version:

# list available versions
gcloud container get-server-config --format "yaml(channels)"

# switch the cluster to the rapid channel
gcloud container clusters update $CLUSTER_NAME --release-channel rapid

# upgrade the control plane
gcloud container clusters upgrade $CLUSTER_NAME \
  --zone $GCP_ZONE \
  --master \
  --cluster-version 1.30.1-gke.1329003

3. Provision a New Node Pool

Rather than upgrading nodes in place, create a new pool running the updated version. This "blue‑green" strategy lets you test the new nodes before removing the old ones and gives you an easy rollback option.

# create a new node pool on the latest version
gcloud container node-pools create updated-node-pool \
  --cluster $CLUSTER_NAME \
  --zone $GCP_ZONE \
  --machine-type e2-standard-2 \
  --num-nodes 2

4. Migrate Workloads

Use Kubernetes scheduling features to move workloads from the old nodes to the new ones:

# mark old nodes unschedulable
kubectl cordon <node-name>

# evict workloads from the old nodes
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --force

After draining, restart any deployments or stateful sets that require zero downtime so that the new pods schedule onto the updated node pool.

5. Delete the Old Node Pool

Once all workloads run successfully on the new nodes, remove the outdated pool:

gcloud container node-pools delete default-pool \
  --cluster $CLUSTER_NAME \
  --zone $GCP_ZONE

This procedure minimizes the risk of downtime during upgrades. On‑premises environments may upgrade nodes in place due to hardware constraints, but when running in the cloud, creating a fresh node pool provides the safest path forward.