Kubernetes — Stuck Rollouts, Version Upgrades and Mistakes
Working a stuck rollout and a CrashLoopBackOff to an undo-or-fix decision, planning a two-minor-version upgrade on kubeadm, EKS, AKS and GKE, and recovering from and preventing mistakes.
Overview
Most production incidents start with a change. A new image rolls out and half the pods never become ready. A cluster upgrade removes an API, a label or a default that something depended on. Someone runs a command against the wrong context. This page covers the three change-driven failures interviewers ask about most: the stuck rollout, the cluster version upgrade, and the mistake.
The common thread is that Kubernetes reports, it does not decide. A stalled Deployment gets a condition, not an automatic rollback. A version upgrade enforces skew rules, but it does not check your add-ons, admission webhooks or manifests for you. A kubectl delete namespace is accepted, asynchronous and cannot be taken back. Your process, your guardrails and your rollback plan are what turn each of these into a short incident instead of a long one.
This page links to the other pages in this guide instead of repeating them. Pod states and exit codes are in Kubernetes Error Triage, the CrashLoopBackOff mechanism in Pod Startup & Scheduling Errors, exit codes and probes in Container Errors, stuck namespaces and finalizers in Control Plane Errors, drain and PDB failures in Node & Scaling Errors, and ReadWriteOnce rollout deadlocks in Storage Errors.
Three ways a change breaks production
Each kind of change has its own first evidence and its own way back, and none of them reverts itself.
- A new pod template (a new image, config or probe) ends in a stuck rollout or a CrashLoopBackOff. The way back is to undo or fix forward, in Git if you use GitOps.
- A cluster version or add-on upgrade ends in a removed API, a broken add-on or a blocked drain. The way back is the provider's rollback window, if there is one, or a fix forward.
- A manual command (delete, apply, edit, scale) ends with the wrong context, a lost namespace or drift. The way back is to re-apply from Git and restore from backup.
Key concepts
- progressDeadlineSeconds
- pod-template-hash
- maxSurge and maxUnavailable
- rollout undo
- Version skew policy
- Deprecated API metric
- Eviction API
- unhealthyPodEvictionPolicy
- Two-step control plane upgrade (GKE)
- ValidatingAdmissionPolicy
Interview questions
- A prod deployment rollout appears stuck. kubectl rollout status has been hanging for 20 minutes, half the pods are up, the other half aren't. What's your process?
- You're asked to upgrade a prod cluster's Kubernetes version by two minor versions. What's your actual risk assessment and rollout plan?
- How do we debug a pod in CrashLoopBackOff state?
- Does Kubernetes roll back a Deployment automatically when it hits ProgressDeadlineExceeded?
- Walk me through maxSurge and maxUnavailable for 10 replicas, and why a 1-replica Deployment can behave differently.
- Someone ran kubectl delete namespace in production. What do you do now, and how do you stop it happening again?
- How do you find out whether anything still uses an API that the target version removes?
- A node drain hangs during a cluster upgrade. Why, and what do you do?
- Can you roll back a control plane upgrade on EKS, GKE, AKS or kubeadm?
- An engineer fixed production with kubectl edit, and an hour later the fix disappeared. What happened?
Sign up free to read the full topic
More DevOps topics
- Jenkins Controller vs Agent Architecture
- Jenkinsfile — Pipeline as Code
- JFrog Artifactory — Production Administration, Errors and Mistakes
- JFrog Xray — Policies, Watches, Impact Analysis, Errors and Mistakes
- Karpenter — Node Autoscaling
- kubectl CLI Command Reference
- Kubernetes Admission Control
- Kubernetes AI and GPU Scheduling
- Kubernetes API Aggregation
- Kubernetes API Errors — 4xx and 5xx Explained
- Kubernetes Architecture
- Kubernetes Autoscaling: HPA, VPA, KEDA, and Cluster Autoscaler
Start free on Cariara · Coding problems · System design studio