Kubernetes interview question · Most asked
How do you upgrade a Kubernetes cluster safely?
Summary
Upgrade one minor version at a time: check deprecated and removed APIs first, upgrade the control plane, then add-ons (CNI, CoreDNS, kube-proxy, CSI drivers, ingress), then nodes, by replacing or draining them in batches while PodDisruptionBudgets keep apps available.
Longer Answer
Preparation: read the changelog, find removed APIs in your manifests and Helm charts (tools such as pluto or kubent), confirm add-on compatibility, and test in a non-production cluster. Version skew rules allow kubelets to be a few minor versions behind the API server but never ahead.
Node upgrades: prefer creating new node groups and moving workloads (blue/green nodes) over in-place upgrades; make sure workloads have multiple replicas, PDBs and graceful shutdown. Kubernetes minor versions are supported for roughly a year, so upgrades are a regular, planned activity rather than a rare event.
Key Points
- One minor version at a time.
- Find removed APIs first.
- Control plane, add-ons, then nodes.
- PDBs, replicas, graceful shutdown; plan regular upgrades.
More most-asked Kubernetes questions
- ConfigMaps and Secrets: how do they differ, and how should secrets really be handled?
- How does the scheduler place pods? Explain resource requests, node affinity, taints and tolerations.
- Describe the Kubernetes architecture: what runs on the control plane and what runs on the nodes?
- How do rolling updates work in a Deployment, and how do you roll back?
- Explain the Service types: ClusterIP, NodePort, LoadBalancer, ExternalName and headless.
- What happens, step by step, when you run kubectl apply for a Deployment?
- Deployment, StatefulSet, DaemonSet, Job and CronJob: when do you use each?
- What is the difference between resource requests and limits, and what are the QoS classes?