Sub topic 17
In-place upgrades versus building a new cluster
This chapter assumes you know basic kubectl usage, the control plane and worker node roles, and the kubeadm upgrade flow from earlier chapters. It compares two ways to move a cluster to a newer Kubernetes version and gives criteria for choosing between them.
The two strategies
An in-place upgrade changes the existing cluster. You upgrade the control plane first, then drain, upgrade, and uncordon each node, as shown in the earlier chapters. The cluster keeps its identity, its etcd data, and its API endpoint.
A replacement upgrade builds a new cluster at the target version. You deploy workloads to it, move traffic over, and retire the old cluster. Teams often call this a blue/green cluster upgrade.
Comparing the trade-offs
| Concern | In-place | Replacement |
|---|---|---|
| Cost | No extra capacity beyond a few surge nodes | Two clusters run side by side during the move |
| Rollback | Restore from an etcd snapshot, which is slow and risky | Send traffic back to the old cluster |
| Version jumps | One minor version at a time | Can jump several versions, since no skew applies between clusters |
| State | etcd data and volumes stay where they are | You must move or re-attach persistent data |
| Identity | Same API endpoint and credentials | New endpoint, new credentials, new webhooks and DNS to update |
| Effort | Fewer moving parts per upgrade | More automation required up front |
Where each strategy fits
In-place upgrades suit most clusters. They need less capacity and keep stateful workloads where they are. The cost is that each minor version is a separate, sequential upgrade. A cluster that is three minor versions behind needs three full passes.
Replacement suits these cases:
- You are many versions behind. Building fresh at the target version avoids the chain of single-step upgrades.
- You want a fast, low-risk rollback path for a critical platform.
- The cluster configuration has drifted and you would rather rebuild from code than inherit it.
- You are changing something an upgrade cannot change, such as the CNI plugin or the Pod network range.
Replacement only works well when the cluster is defined as code, workloads deploy from version control, and persistent data can move. Without these, you end up rebuilding by hand and the risk goes up.
Handling stateful workloads
Stateful data is the hardest part of a replacement. Options include restoring from a volume snapshot, replicating data at the application level (for example, a database replica in the new cluster), or re-attaching the same storage volumes if your storage backend allows it. Test the data path early, because it usually decides whether replacement is practical.
Making the choice
Start with in-place when you are one or two versions behind and your storage ties data to the cluster. Choose replacement when you are far behind, need an instant rollback, or already build clusters from code. Whichever you pick, the version skew policy, add-on checks, and verification steps from earlier chapters still apply.
Exercise
Your cluster is four minor versions behind, is defined in Terraform, and runs stateless web workloads whose manifests live in Git. Which strategy do you pick, and give two reasons?
Show answer
Replacement. Four in-place passes would be needed, one minor version each, and the stateless workloads move easily. Since the cluster is built from code and manifests are in Git, a new cluster is cheap to create, and traffic can shift back to the old cluster if something goes wrong. You still need to migrate any removed API versions in the manifests first.
Exercise
Why is rollback usually easier with a replacement upgrade than with an in-place upgrade?
Show answer
The old cluster stays untouched while you test the new one, so you can send traffic back to it. An in-place rollback means restoring an etcd snapshot, because Kubernetes does not support downgrading, and that takes longer and can lose changes made after the snapshot.