← All writing

Zero-Downtime Kubernetes Cluster Upgrades: Multi-Cloud Masterclass (EKS, GKE, AKS, OKE)

· Sourabh G Kulkarni

Upgrading Kubernetes control planes and worker nodes without service interruption: cloud skew policies, Pod Disruption Budgets, and the interview deep-dive.

Zero-Downtime Kubernetes Cluster Upgrades: Multi-Cloud Masterclass (EKS, GKE, AKS, OKE)

Upgrading a production Kubernetes cluster is the ultimate test of a platform engineer. Anyone can spin up a cluster; keeping live customer traffic uninterrupted while migrating the control plane, replacing node operating systems, and updating kubelet versions across hundreds of pods is what separates senior engineers from beginners.

Whether running on AWS EKS, Google Cloud GKE, Azure AKS, or Oracle OKE, the fundamental principles of zero-downtime upgrades remain consistent.

flowchart TD
    subgraph Step1["Step 1: Control Plane Upgrade"]
        CP["Managed Control Plane (API Server, etcd)"]
        UpgradeCP["Upgrade to v1.31 (Cloud handles HA automatically)"]
    end

    subgraph Step2["Step 2: Add New Node Group (Blue/Green)"]
        OldNG["Old Node Group (v1.30) - Active"]
        NewNG["New Node Group (v1.31) - Ready"]
    end

    subgraph Step3["Step 3: Graceful Drain & Eviction"]
        PDB["PodDisruptionBudget (minAvailable: 1)"]
        Drain["kubectl cordon & drain old nodes"]
        Shift["Traffic shifts seamlessly via Service / Ingress"]
    end

    CP --> UpgradeCP
    UpgradeCP --> NewNG
    NewNG --> Drain
    Drain --> PDB
    PDB --> Shift

1. The Cardinal Rule: Upgrade Sequence & Version Skew

The Kubernetes version skew policy dictates:

  • The Control Plane must ALWAYS be upgraded first, before any worker nodes.
  • Worker nodes (kubelet) can never be newer than the API server.
  • Never skip minor versions: Upgrading from 1.29 to 1.31 directly is unsupported. You must upgrade 1.29 $\rightarrow$ 1.30 $\rightarrow$ 1.31.

2. Zero-Downtime Safeguards: PDBs & Graceful Termination

Before touching a single node, you must configure two cluster primitives:

A. Pod Disruption Budgets (PDB)

Ensures Kubernetes refuses to drain a node if evicting the pod drops capacity below a critical threshold:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: api-gateway-pdb
  namespace: production
spec:
  minAvailable: 2 # At least 2 replicas MUST stay healthy at all times
  selector:
    matchLabels:
      app: api-gateway

B. Graceful Shutdown & PreStop Hooks

Give your application time to drain open TCP connections before receiving SIGKILL:

spec:
  containers:
    - name: api
      lifecycle:
        preStop:
          exec:
            command: ["/bin/sh", "-c", "sleep 15"] # Let Ingress stop routing new traffic

3. Node Upgrade Strategies: In-Place vs. Blue/Green Node Groups

Strategy A: Rolling In-Place (Surge Upgrades)

The cloud provider provisions a temporary surge node, drains an old node, replaces it, and repeats.

  • Pros: Zero manual infrastructure provisioning.
  • Cons: Slower for massive clusters; if an issue arises mid-upgrade, rollback is complex.

Strategy B: Blue/Green Node Groups (The Enterprise Standard)

  1. Provision a completely new Node Group with the target version (v1.31).
  2. Verify all nodes report Ready and networking CNI is healthy.
  3. Cordon the old node group (kubectl cordon -l eks.amazonaws.com/nodegroup=ng-v1-30).
  4. Drain nodes gradually (kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data).
  5. As pods are evicted, the scheduler schedules them onto the new v1.31 node group.
  6. Once empty, delete the old node group.

4. Multi-Cloud Comparison (Interview Cheatsheet)

Cloud ProviderServiceControl Plane HARecommended Node Upgrade Method
AWSEKSManaged ENIs into VPC; AWS handles API server failoverCreate new Managed Node Group; drain old node group
GCPGKERegional clusters (3 replicas across 3 AZs)GKE Surge Upgrades (automated) or Blue/Green Node Pools
AzureAKSManaged master; SLA guaranteed with Paid tierNode Image Upgrade with maxSurge buffer
OracleOKEFully managed control plane across ADsOut-of-place Node Pool swap with worker draining

Top Interview Question:

"What happens during kubectl drain if a pod doesn't have a Pod Disruption Budget?" Answer: kubectl drain sends eviction requests to the API server. Without a PDB, all replicas of the deployment on that node can be evicted simultaneously. If replicas are concentrated on that single node, the service experiences immediate downtime.