fix(pdb): require minAvailable < replicas so PodDisruptionBudgets stay satisfiable#110
Open
monrax wants to merge 1 commit into
Open
fix(pdb): require minAvailable < replicas so PodDisruptionBudgets stay satisfiable#110monrax wants to merge 1 commit into
monrax wants to merge 1 commit into
Conversation
Both PodDisruptionBudgets rendered whenever replicas met a fixed threshold (datanode >= 1, graylog >= 2) but never checked minAvailable against the actual replica count. Enabling a PDB on a small cluster (e.g. datanode.replicas=1 or 2 with the default minAvailable=2) produced a budget with disruptionsAllowed=0, silently blocking every voluntary eviction -- node drains for maintenance and cluster-autoscaler scale-down would hang indefinitely. Replace the replica-threshold gate with the same invariant the MongoDB template already enforces for arbiters: fail fast when minAvailable >= replicas, with a message pointing at the misconfigured values. Also gate the datanode PDB on datanode.enabled (it previously rendered even when the datanode was disabled) and align the datanode minAvailable fallback (3 -> 2) with values.yaml so nulling the value no longer silently raises the floor. Adds helm-unittest coverage for both PDBs: no-render defaults, the enabled/satisfiable case, and the fail-fast misconfig cases. Co-Authored-By: Claude Opus 4.8 (1M context) <[EMAIL_ADDRESS_REDACTED]>
Collaborator
Author
Live validation on EKSValidated on EKS (2× m6i.2xlarge, MongoDB Community operator), installed with
|
Collaborator
Author
Foot-gun live-validated on the
|
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.
Summary
Both PodDisruptionBudgets could render as unsatisfiable on small clusters, silently producing
disruptionsAllowed: 0and blocking every voluntary eviction (kubectl drain, node cordon for maintenance, cluster-autoscaler scale-down). The templates rendered a PDB whenever the replica count met a fixed threshold (datanode >= 1,graylog >= 2) but never comparedminAvailableto the actual replica count. This enforces the invariantminAvailable < replicas, matching the fail-fast idiom the MongoDB template already uses for arbiters.Example of the broken case (DataNode, default
minAvailable: 2):datanode.replicasminAvailabledisruptionsAllowedDetails
failwhenminAvailable >= replicas, mirroringcustom/mongo-rs.yaml("arbiters must be less than replicas"). The error names the misconfigured values.datanode.enabled(it previously rendered even when the DataNode was disabled).minAvailablefallback (3->2) withvalues.yaml, so nulling the value no longer silently raises the floor.Behavior change: a PDB enabled with
minAvailable >= replicasnow fails at render/install time instead of installing a silently-broken budget — the same surface a bad arbiter count already has.Linked issues
No linked issue — surfaced while auditing the chart against the 2025-12 third-party evaluation (which flagged the PDB gating direction; this fixes the underlying
minAvailable-vs-replicas relationship the gate never validated).PR Checklist
Please check the items that apply to your change.
Testing Checklist
Static Validation
helm lint ./charts/grayloghelm template graylog ./charts/graylog --validateInstallation
helm install graylog ./charts/graylogkubectl rollout status statefulset/grayloghelm test graylogFunctional (if applicable)
Upgrade (if applicable)
Specific to this PR
helm unittest ./charts/graylogpasses — 66 tests, incl. 10 new PDB casesminAvailable(graylog 1/2 replicas, datanode 2/3 replicas)minAvailable >= replicasfails with a clear messagedatanode.enabled=falseNotes for reviewers
🤖 Generated with Claude Code