Email copiado — support@tuurt.com
Cargando experiencia
kubernetes · November 09, 2026 · 6 min

PodDisruptionBudgets in Kubernetes: How We Stop a Node Drain From Taking Down a Service

A PodDisruptionBudget that exists and computes correctly can still let a whole service go down if it isn't tied to the real replica count. We walk through minAvailable, maxUnavailable, and the mistake that makes them useless.

By Tuurt Team

PodDisruptionBudgets in Kubernetes: how we stop a node drain from taking down an entire service

A cluster version upgrade, an instance type change on a node pool, or simply the node autoscaler reclaiming capacity nobody is using: all of these eventually come down to evicting pods from a node before shutting it off. Kubernetes calls that a voluntary disruption, and it is exactly the kind of event a PodDisruptionBudget (PDB) exists to control. The problem is rarely that teams don't know the resource exists. It's that they configure it once, with a value that looked reasonable at the time, and never revisit it when the service's actual replica count changes.

What a PDB protects against, and what it doesn't

A PDB doesn't protect against every kind of interruption. It specifically guards voluntary disruptions that go through the Eviction API: a kubectl drain, a node upgrade managed by the cloud provider, or the cluster autoscaler scaling down a node. When something tries to evict a pod through that path, the API server checks the matching PDB and returns a 429 if evicting it would drop the service below the allowed minimum.

What a PDB does not cover is an involuntary disruption: a node that goes down from a hardware fault, a pod killed by OOM, or a forced termination via kubectl delete pod --grace-period=0 --force. None of those go through eviction, so there's nothing for the PDB to block. This matters because when a drain stalls waiting for the PDB to allow it, the temptation to resolve it with --force or a direct pod deletion is real, and doing so removes exactly the protection the PDB was providing.

minAvailable and maxUnavailable are not the same guarantee

A PDB is defined with one of two fields, never both:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: payments-api-pdb
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: payments-api

minAvailable: 2 tells the cluster "never authorize an eviction that would leave fewer than 2 healthy pods running." It's a guarantee on the availability floor, independent of how many total replicas the deployment happens to have at that moment.

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: payments-api-pdb
spec:
  maxUnavailable: 1
  selector:
    matchLabels:
      app: payments-api

maxUnavailable: 1 says something different: "never authorize more than 1 pod being unavailable at once due to a voluntary disruption." The difference isn't just phrasing. The controller computes how many evictions it allows (disruptionsAllowed, visible with kubectl get pdb) in two different ways depending on which of the two fields was used, and that difference is exactly where the error described below shows up.

The error that leaves the PDB with no real effect

The most common failure isn't a PDB that's syntactically wrong. It's a PDB that computes correctly, but against a replica count that no longer matches the real service.

Take maxUnavailable: 1 on a service that, at the time the PDB was written, ran 3 replicas. It looks conservative: at most one pod disrupted at a time, always 2 left serving traffic. Months later, someone adjusts that service's HPA bounds, and during low-demand hours the deployment scales down to a single replica. Nobody touches the PDB, because the PDB never raised an alert or an error: it still exists, still gets evaluated, still returns a valid response whenever it's queried.

The formula the controller uses for maxUnavailable is desiredHealthy = replicas - maxUnavailable. With 3 replicas and maxUnavailable: 1, desiredHealthy is 2, and the PDB correctly protects that floor. But with 1 replica and the same maxUnavailable: 1, desiredHealthy is 0. The PDB computes that it can authorize evicting the only remaining pod, because leaving 0 healthy pods still technically satisfies "at most 1 unavailable." During the next scheduled node drain, the controller evaluates the PDB, finds it satisfied, authorizes the eviction, and the service goes fully down for however long it takes the new pod to get scheduled and pass its readiness probe. The PDB existed the entire time, never failed, never returned an error, and still didn't prevent the full outage, because the number that made it safe stopped being true the moment the real replica count changed.

How we pin the PDB so it doesn't depend on a frozen fixed number

The fix isn't simply raising the minAvailable value. It's tying the PDB to the same reference the service's autoscaling uses, instead of to a number copied in once.

For services with an HPA, we express minAvailable as a percentage of the HPA's configured minimum replica count, never against the maximum or against a value observed during a high-traffic moment:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: payments-api-pdb
spec:
  minAvailable: 60%
  selector:
    matchLabels:
      app: payments-api

With an HPA minimum of 2 or more replicas, 60% rounds up to a number that still leaves at least one healthy replica even at the scale floor. The exact percentage isn't the point. The point is that the guarantee gets computed against the worst-case replica count the service can actually reach in production, not against the typical case someone happened to observe when they wrote the PDB.

We also added a simpler but equally important rule: no service with traffic on the critical path runs with an HPA minimum of 1 replica. A PDB can't give real availability to a service that, by design, has no redundancy to protect in the first place.

What didn't work on the first attempt

The first fix we tried, as soon as we spotted the pattern during an audit of existing PDBs, was bumping every minAvailable to a generous fixed number, on the assumption that more margin is always safer. It didn't work: on services where the HPA legitimately scaled down to 1 or 2 replicas overnight, a fixed minAvailable sized for peak-hour traffic blocked every eviction during those windows, and scheduled node drains sat stuck waiting on pods that never got released. That produced the exact opposite failure mode: operations started using --force on stalled drains to avoid blocking the cloud provider's maintenance windows, which removes the PDB's protection entirely at the exact moment it matters most.

What worked was expressing the PDB as a percentage of the service's real scale-down floor instead of an observed number, and reviewing that percentage every time the HPA configuration changes, as part of the same change rather than a separate task someone is supposed to remember later.

What we check before signing off on a PDB

Before considering a service protected, we confirm the disruptionsAllowed value with kubectl get pdb at the lowest replica count the service can actually reach under its HPA configuration, not at the moment the manifest was written. We check that no PDB is expressed as a fixed number that depends on the deployment never scaling below the value it had when the PDB was created. And we run an actual drain, or at minimum a kubectl drain --dry-run followed by a manual eviction, against that configured replica floor, because a PDB that's never been exercised in that scenario is, in practice, an unverified PDB.

kubernetes devops availability cloud
← Back to blog