Pod disruption budgets for zero-downtime maintenance

Pod disruption budgets tell Kubernetes how many pods of a workload must stay available during voluntary disruptions such as drains and upgrades. This page covers how to set them so maintenance does not cause outages or stall indefinitely.

On this page

How pod disruption budgets keep services up during node drains

A PodDisruptionBudget (PDB) limits how many pods of a set can be voluntarily evicted at the same time, so a node drain or upgrade cannot remove every replica of a service at once. You define the budget with either minAvailable or maxUnavailable, select pods with a label selector, and the cluster refuses evictions that would violate it. Kubernetes classes disruptions as voluntary, such as a cluster administrator draining a node or an upgrade removing a node, or involuntary, such as hardware failure, a kernel panic or an out-of-memory kill. Budgets only govern voluntary disruptions, and only when the eviction goes through the Eviction API, which is what kubectl drain uses. Deleting a pod directly or a node failing outright bypasses the budget entirely.

Teams usually need budgets in three situations: services with several replicas that must keep serving during rolling maintenance, stateful workloads that depend on a quorum such as etcd-like or database clusters, and any node pool that you upgrade regularly. Before you rely on a budget, confirm the current behavior of minAvailable, maxUnavailable and the policy around unhealthy pods in the official PodDisruptionBudget documentation for the Kubernetes version you run, since eviction handling has changed across releases. Also check how your drain command and any cluster autoscaler interact with evictions in your environment, because a budget that the drain tooling ignores protects nothing. Test the budget on a non-production cluster by draining a node that hosts a protected workload and observing whether the eviction waits.

minAvailable, maxUnavailable and selectors: which setting fits which workload

This table compares the four budget settings that decide how many pods a drain may remove, and the workloads each one suits. Read each row as a decision: match the workload's replica behavior to the setting, then confirm the selector matches the pods you intend to protect. The main takeaway is that a budget that matches no pods protects nothing, and percentages round in ways that can surprise you at small replica counts.

SettingHow it worksFits bestWatch for
minAvailable as a countRequires at least this many matching pods to stay available during voluntary disruptionFixed-size stateful quorums, such as a three-member etcd or database cluster where the quorum number never changesSetting it equal to the replica count blocks every drain, so the node cannot be emptied
minAvailable as a percentageKeeps at least this share of matching pods available, rounded up to whole podsStateless deployments that scale with load, where the count changes over timeRounding up at small counts can leave little room to evict; two replicas at 50 percent still needs one pod running
maxUnavailable as a countAllows at most this many matching pods to be unavailable at onceStateless workloads with a fixed number of replicas that should roll through drains one pod at a timeA value of zero blocks all voluntary evictions, the same effect as a full minAvailable
maxUnavailable as a percentageAllows at most this share of matching pods to be unavailable, rounded down to whole podsAutoscaled deployments where the replica count grows and shrinks with trafficRounding down at small counts can allow zero evictions, so a single-replica workload stays blocked
Label selectorDefines which pods the budget counts; pods outside the selector are not protectedEvery budget, scoped to the app label of the workload it protectsA label typo or a changed label silently matches no pods, and the drain proceeds without protection
Unhealthy pod eviction policyControls whether pods that are not Ready can be evicted regardless of the budgetWorkloads where crash-looping pods should not hold up node drainsConfirm the policy field and its default in your Kubernetes version before relying on it

How the eviction API checks budgets during a drain

When you run kubectl drain, the command does not delete pods directly. It asks the API server to evict each pod through the Eviction API, and the API server checks any matching PodDisruptionBudget before it removes the pod. If the budget shows that removing one more pod would drop the healthy count below its floor, the eviction is refused with a response that tells the drain to retry later. The drain then waits and keeps retrying the same pod, so it can appear stuck while the rest of the node's pods stay in place. A budget only protects pods that the Eviction API handles. Pods removed by other means, such as deleting a pod or a node failing, do not consult it.

The outcome depends on the arithmetic of minAvailable or maxUnavailable against the number of healthy replicas the budget currently counts. A budget that allows zero disruptions, for example minAvailable equal to the total replica count, or maxUnavailable: 0, refuses every eviction, so a drain of a node carrying one of those pods cannot finish until something else changes. A budget that allows some disruptions lets evictions proceed one at a time while the healthy count stays above the floor. Degraded workloads change this. If one of three replicas is already unhealthy, a minAvailable: 2 budget allows no further disruption even though the spec looks permissive, so a routine drain stalls. Before a maintenance window, check the ALLOWED DISRUPTIONS column with kubectl get pdb, and confirm the expected behavior in your own cluster by draining a test node with a sample workload. Kubernetes behavior around these checks is described in the Kubernetes documentation on disruptions, and your Kubernetes version's release notes should be read for any change to eviction behavior.

Budgets that block drains forever and other common failures

A pod disruption budget protects availability, but a budget that is too strict or too loose can stall an upgrade or leave a service exposed. The cards below cover the traps that most often surface during node drains, and each one names the symptom to look for and the general fix.

Zero allowed disruptions on scaled workloads

A budget with maxUnavailable: 0, or a minAvailable equal to the replica count, allows no voluntary eviction at all. The drain stops on the first pod it cannot evict, and the node stays cordoned while the upgrade waits. During an upgrade, kubectl drain repeats eviction attempts and reports the budget as the reason. The fix is to allow at least one disruption, usually by setting maxUnavailable to 1 or by keeping minAvailable below the replica count, and to confirm that the workload has enough headroom to absorb one pod leaving.

Kubernetes docs

Budget matching pods that never become ready

The disruption budget counts healthy pods, so if the replacement pods never reach Ready, the budget stays exhausted and blocks eviction of the old ones. Common causes include failing readiness probes, image pull errors and missing config or secrets after a change. During an upgrade the drain hangs while the rollout looks stuck in a different place. Check readiness and rollout status before you blame the budget, and confirm that the pods the budget counts are the ones actually serving traffic.

Single-replica workloads without a strategy

A single-replica workload with a budget of minAvailable: 1 cannot be evicted voluntarily without downtime, so the drain blocks. Teams often respond by deleting the budget, which removes the protection and still causes an outage when the node goes down. Decide in advance whether the service accepts a planned interruption, adds a second replica on another node, or is scheduled into a maintenance window. Record that decision with the workload owner, because the cluster cannot make it for them.

Selectors that match nothing or too much

A budget's label selector decides which pods it governs. A selector that matches no pods leaves the workload unprotected, while one that matches pods from several deployments can block drains across services that do not share a failure mode. Labels that change between chart versions often cause the first problem after an upgrade. Compare the budget's selector with the pod labels using a label query, and check the expected healthy count after each release that touches labels.

Drains stalled on DaemonSet and unmanaged pods

A drain refuses to evict DaemonSet pods and standalone pods that have no controller unless the operator passes flags that allow it. Without those flags the drain stops before any budget is checked, which looks like a budget problem but is not one. Mirror pods and pods using local storage can stall it in similar ways. Treat these as a separate category: ignore DaemonSet pods deliberately in the drain command, and move unmanaged pods under a controller before the maintenance window.

How to roll out budgets across a cluster before the next upgrade

This sequence moves disruption budgets from inventory to production in a controlled order, so drains and upgrades keep services available and every workload has a named owner.

  1. Inventory workloads by replica count and criticality

    The platform team lists every Deployment, StatefulSet and ReplicaSet that runs pods across nodes, with its replica count, the namespace it lives in, the team that owns it and how much an outage would hurt the business. Include single-replica workloads as their own group, because no budget can keep them up during a drain. Done when the inventory is a spreadsheet or file in version control that lists every workload with an owner and a criticality label. Confirm the list against kubectl get deploy,sts -A so nothing is missed.

  2. Choose a budget type for each workload

    For each workload, the platform team decides between minAvailable and maxUnavailable in a PodDisruptionBudget. Use minAvailable when a fixed number of pods must always run, and maxUnavailable when the service can tolerate a set number of pods leaving at once. Record the choice and its reason next to the workload, and mark single-replica workloads for a separate decision, since a budget that protects one pod either blocks the drain or does nothing. Done when every workload in the inventory has a documented budget type or an explicit exception.

  3. Create budgets in a staging cluster

    The platform team applies the PodDisruptionBudget manifests to a staging cluster that mirrors production's workloads and replica counts. Keep the manifests in Git so changes are reviewed the same way as other cluster configuration. Verify that each budget was accepted by running kubectl get pdb -A and reading the ALLOWED DISRUPTIONS column. A value of zero for a workload with healthy replicas is a signal to check the replica count and the selector before going further.

  4. Drain a test node and observe the result

    On a staging node, the platform team runs kubectl drain with the flags required for DaemonSets and local data, then watches which pods are evicted and in what order. Confirm that the eviction API respects each budget and that replacement pods become Ready on other nodes before the next pod leaves. The check is complete when the drain finishes and the service endpoints show no gap in healthy backends. Record the result so the owners of each workload can see what the drain did.

  5. Check for stalled drains

    Before production, the team looks for budgets that would block a drain indefinitely, such as a minAvailable value equal to the replica count or a budget that matches no pods. Run a second test drain and watch for eviction requests that keep returning errors. A drain that does not complete within the window the team sets is a stall, and the fix is usually to lower the budget, add replicas or scale the workload temporarily. Done when test drains of every node pool finish without manual overrides.

  6. Apply budgets to production and confirm allowed disruptions

    The platform team applies the reviewed manifests to production through the same pipeline used in staging, during a change window agreed with the application owners. After applying, list budgets with kubectl get pdb -A and confirm that each one reports allowed disruptions consistent with the replica count. Then run one production node drain under observation before the upgrade begins. The step is done when the production drain completes and the owners confirm their services stayed available.

  7. Document owners and the exception list

    The team records, for each budget, the workload owner, the budget type, the reason for the choice and the review date, and keeps the list alongside the cluster runbook. Single-replica workloads and any budget exceptions go on a separate list with the risk accepted by the owner. Ask each owner to confirm in writing which workloads they expect to tolerate planned disruption. The step produces a maintained register that the upgrade team uses when it plans each drain.

How a drain request moves through the eviction check

The drain starts at the operator's kubectl drain command, which asks the Eviction API to remove each pod on the node. The Eviction API looks up the matching PodDisruptionBudget and either allows the eviction or refuses it, and a refusal is what stalls a drain. Allowed pods are rescheduled by the scheduler, and if capacity runs short the cluster autoscaler may add or remove nodes. Check the budget's allowed disruptions before you start the drain.

Eviction requests pass a PodDisruptionBudget check before pods move.

Coordinating budgets with cluster autoscaling and node upgrades

Cluster scale-down and node upgrades both remove pods from nodes, and both have to respect the PodDisruptionBudget objects in the cluster. The conflicts appear when those two processes meet a budget that leaves little room. A drain or a scale-down can only evict a pod if the budget still allows it, and the evicted pod then needs somewhere to run. If the remaining nodes lack spare CPU and memory, the replacement pod stays Pending, the budget stays under pressure, and the drain stalls. Before you set a budget that allows zero voluntary disruptions, check that the rest of the node pool can absorb the pods that would move off a node being removed.

Two failure patterns deserve a test before production. The first is a node removal that proceeds while a pod is still Pending because the scheduler found no room. The second is an upgrade that cordons and drains nodes in an order that concentrates a workload on the last remaining nodes of one pool. Plan upgrade order across node pools so each workload keeps enough healthy replicas and spare capacity while its node is drained. Pools that host stateful or single-replica workloads usually need their own sequence, with a maintenance window agreed with the service owners.

Confirm the behavior in your environment rather than relying on assumptions. Record the cluster autoscaler version you run, the upgrade tooling and its drain options, and whether the autoscaler's scale-down logic honors budgets in that version. Then rehearse a scale-down and a node upgrade on a non-production cluster with the same budgets and workload set, and watch for pods stuck Pending or drains that wait on a budget. Ask your platform or managed-service provider to document how their node upgrade process interacts with budgets, and keep the results with your runbook so the next upgrade starts from evidence.

Security and operational considerations for budgets

A budget is a small object with large effects: it can stop a drain, and it can be edited by anyone who can change a namespace. The cards below cover who may change budgets and evict pods, how edits get reviewed, how stalled drains are spotted, how budgets behave during incidents, and who answers for each workload.

Limit who can edit budgets and evict pods

Creating or editing a PodDisruptionBudget and calling the eviction endpoint are separate permissions, and both should be reviewed in RBAC. A user who can loosen a budget or evict pods can remove the protection a maintenance plan depends on. Check which service accounts, CI pipelines and operators hold the policy API group permissions, and confirm that only platform roles can evict pods in production namespaces.

Authentication docs

Review budget edits in Git

When budgets are stored in a GitOps repository, every change to minAvailable or maxUnavailable should go through the same pull request review as other production manifests. A quiet change from minAvailable: 2 to minAvailable: 3 on a three-replica service can block every drain on its nodes. Require a reviewer from the owning team and the platform team for budget changes.

Watch for stalled drains

A budget that cannot be satisfied leaves kubectl drain waiting, often without a clear error in the terminal. Set alerts on drains or node maintenance jobs that run longer than your normal window, and check status.disruptionsAllowed on budgets that show zero for long periods. Stalled drains are most often caused by a budget that never gets its replicas back to Ready.

Plan for incidents and forced removal

During an incident, a budget can slow the work needed to recover, such as draining a failing node or moving pods off a host with a bad disk. Decide in advance who may override a budget, how that override is recorded, and whether a forced node removal is treated as an involuntary disruption that budgets do not stop. Test this path in a non-production cluster before you need it.

Name an owner for each budget

A budget without a named owner tends to be left wrong after the workload changes its replica count or autoscaling range. Record the owning team, the expected replica count and the reason for the chosen value, either as annotations on the budget or in the service catalog. Ask each owner to review their budgets after major releases and changes to horizontal autoscaling.

Questions teams ask before hiring help with disruption budgets

What makes disruption budget work cost more or less?

The cost follows the number of workloads that need a budget, how many of them are stateful, and how many node pools and drain paths the cluster has. Each workload needs its replica count, its readiness behavior and its dependencies reviewed, so a cluster with dozens of simple stateless services is far less work than one with a few replicated databases, message brokers and custom operators. Drain tooling matters too: a cluster that upgrades through a managed pipeline with its own eviction logic needs different checks than one where engineers run kubectl drain by hand. Ask any provider to quote from a written inventory of workloads, node pools and maintenance tooling rather than from a headcount estimate.

How long does scoping take, and what does it need from our team?

Scoping depends on how well your team already documents its workloads. The work needs named workload owners who can confirm replica counts, acceptable downtime and startup behavior, a staging cluster where drains and budget changes can be tested before production, and a change window agreed for the first production drain. Without a staging cluster, every budget change becomes a production experiment. Ask the provider to list which of these inputs they need before the scope is written, and which ones your team must supply, so the schedule reflects your actual availability.

Can our internal platform team set up disruption budgets on its own?

Often yes, for a small cluster with a few well-understood services. The Kubernetes documentation covers minAvailable and maxUnavailable, and a team that already runs drains and upgrades can apply budgets incrementally. The harder part is judgment: deciding which workloads need a budget, choosing between minAvailable and maxUnavailable for each one, handling single-replica services, and checking that budgets do not block drains indefinitely. Teams that lack an owner for those decisions, or that have never seen a drain stall on a budget, usually benefit from an outside review. Your engineers should still own the final configuration, since they will operate it after the engagement ends.

What does a DeployOpen engagement cover for disruption budgets?

DeployOpen plans, implements, tests and documents disruption budgets as part of a fixed-scope engagement, with scope, deliverables and timelines agreed in writing before work starts. In practice this can include an inventory of workloads and their replica and dependency settings, budget design for each workload, a review of drain and upgrade procedures, testing in a cluster you provide, and documentation your operators can follow. Coordination with cluster autoscaling and node pool settings can be part of the scope when it affects drains. Ongoing upgrades and continuous review are available as retainers. The written scope defines what is excluded.

What goes wrong most often with budgets in production?

The most common failure is a budget that cannot be satisfied, such as a minAvailable value equal to the replica count, which blocks every voluntary eviction and stalls node drains. Single-replica workloads are the second source of trouble, because a budget cannot protect a pod that has no spare copy, so the workload needs a replica change or a planned maintenance window instead. Budgets also fail silently when replica counts change during scaling events and no one rechecks them. Confirm with your team that drain stalls are monitored and that someone owns each budget when a service changes.

Do disruption budgets protect against node failures?

No. A PodDisruptionBudget applies to voluntary disruptions such as drains, upgrades and some evictions. It does not stop a node crash, a hardware fault or an involuntary eviction from removing pods. Protection against those failures depends on spreading replicas across nodes and zones, which is handled through topology spread constraints and anti-affinity. Confirm with your architects which failures your design must survive, because budgets and spreading rules solve different problems and both are needed for a service that must stay up during maintenance.

How DeployOpen scopes and delivers disruption controls

DeployOpen is a Chainscore Labs company that plans, implements, hardens and supports self-hosted open-source platforms inside the infrastructure you control, including your cloud accounts, data centers and air-gapped networks. For disruption controls, that means working through your workloads, their replica counts, their drain paths and your autoscaler settings before anyone writes a PodDisruptionBudget, so the budgets match how your services actually fail and recover.

Most engagements are fixed-scope. Before work starts, the scope, deliverables and timelines are agreed in writing. For a disruption controls engagement, the written scope typically lists the namespaces and workloads in play, which budgets will be created or revised, how single-replica services will be handled, how the cluster autoscaler and node drain procedure will be tested, and what evidence you receive at the end, such as manifests, a runbook and a record of drain tests. A quote follows from that written scope, so the more precisely your inventory of workloads is described up front, the more accurate the quote. Ask for the assumptions behind any estimate, including which environments are covered and who performs the drain rehearsals.

Ongoing support is available as a retainer. Budgets drift as teams add replicas, change rollout strategies or move to new Kubernetes minor versions, so a retainer can cover periodic review of budgets against workload changes, drain testing before each planned upgrade and help with blocked drains when they occur. Confirm during scoping which of these activities your own team will own after handover and which you want to keep under retainer.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.