Skip to main content

How do I keep my app available during an upgrade (PDBs, anti-affinity)?

Syself support For release

To keep pods available during a Kubernetes node upgrade, run at least two replicas on different nodes and add a PodDisruptionBudget. By default, Syself Autopilot rolls each pool one node at a time and drains a node before it removes it, so a workload set up like this keeps serving. The same settings cover a node that self-healing reboots or replaces.

Every production workload needs:

  • At least two replicas.
  • A PodDisruptionBudget, which tells Kubernetes how many pods of the workload may be down at the same time. A drain then evicts your pods step by step and not all at once.
  • A topology spread with maxSkew: 1 across hostnames, or pod anti-affinity, so the replicas run on different nodes and one drain takes only a small share of them.
  • A readiness probe, so traffic reaches a new pod only when it can serve.
  • Resource requests on every container, so the scheduler places the pods on nodes with room for them.

A drain waits for a PodDisruptionBudget only until the pool's drain timeout ends. If your application needs longer to shut down, raise nodeDrainTimeoutSeconds for that pool. See Can we set the drain timeout and a pause between nodes?

Start from the manifest in Survive node drains, which has all of these settings. For what Syself Autopilot does during an upgrade, see How do upgrades work? Is there downtime?

Still stuck?

Prepare your case, then email us.