fix(k8s): default PodDisruptionBudget to maxUnavailable:1#307
Closed
Cre-eD wants to merge 1 commit into
Closed
Conversation
Semgrep Scan ResultsRepository:
Scanned at 2026-06-01 21:02 UTC |
Security Scan ResultsRepository:
Scanned at 2026-06-01 21:03 UTC |
The default PDB was minAvailable:1, which on a single-replica Deployment resolves to disruptionsAllowed:0. That forbids the eviction API, so the cluster autoscaler can never drain the pod's node — on GKE Autopilot the node can never be consolidated and stays pinned regardless of utilization, billing an underutilized node per single-replica service. Default to maxUnavailable:1 instead: disruptionsAllowed:1 lets the pod be evicted and rescheduled for consolidation, while still bounding voluntary disruptions to one pod at a time for multi-replica deployments. Explicitly configured budgets are honored unchanged. Default extracted into a testable helper with coverage. Signed-off-by: Dmitrii Creed <creeed22@gmail.com>
Cre-eD
force-pushed
the
chore/pdb-default-maxunavailable
branch
from
June 1, 2026 21:02
627640f to
6b6c9b9
Compare
Contributor
Author
|
Closing in favor of a contained per-repo config sweep (cloudExtras.disruptionBudget: maxUnavailable:1) across the PAY-SPACE app stacks, to avoid an org-wide SC version bump. May revisit the default later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DeploySimpleContainerdefaults every Deployment's PodDisruptionBudget tominAvailable: 1when the stack doesn't configure one. On a single-replicaDeployment that resolves to
disruptionsAllowed: 0: the eviction API refuses toevict the only pod, so the cluster autoscaler can never drain the node it runs on.
On GKE Autopilot this is expensive — such a node can never be consolidated and
stays provisioned regardless of utilization, so every single-replica service
effectively pins (and bills) a node. Empty nodes are still reclaimed, but any node
hosting one of these pods reports
scaleDown: NoCandidates.Fix
Default to
maxUnavailable: 1instead ofminAvailable: 1:disruptionsAllowed: 1: the pod can be evicted andrescheduled, so the autoscaler can drain and consolidate the node (a brief
restart during the drain, same as a rolling update).
(equal-or-safer than the old
minAvailable:1, which permitted up to N-1).disruptionBudgetis honored unchanged.The default is extracted into a small pure helper (
defaultDisruptionBudget) witha unit test, so a regression back to the node-pinning default fails CI.
Compatibility
Stacks that set
disruptionBudgetexplicitly are unaffected. Stacks relying on thedefault pick up the new value on their next deploy.