Skip to content

feat: configurable PodDisruptionBudget per component - #127

Merged
joe-armstrong merged 3 commits into
mainfrom
joe-armstrong/configurable-pdb
Sep 24, 2026
Merged

joe-armstrong merged 3 commits into
mainfrom
joe-armstrong/configurable-pdb

Conversation

@joe-armstrong

@joe-armstrong joe-armstrong commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

Every operator-managed PDB uses a hard-coded minAvailable: 1. With 20 OpAMP pods that allows 19 to be evicted at once during a node drain or autoscaler scale-down, and with 3 NATS pods it allows 2. This makes the budget configurable per component.

What changed

  • Added an optional podDisruptionBudget field to spec.bindplane, spec.opamp, spec.nats and spec.transformAgent. It uses the upstream policy/v1 PodDisruptionBudgetSpec.
  • The operator sets the selector. CEL rules and the shared validation package reject specs that set selector or both minAvailable and maxUnavailable. unhealthyPodEvictionPolicy is passed through.
  • When the field is unset, the PDB keeps minAvailable: 1. disablePodDisruptionBudget: true still removes the PDB.
  • Regenerated the CRD, deepcopy code and API docs, and updated the autoscaling and configuration docs.

Testing

  • Added envtest cases for the default, maxUnavailable, minAvailable, switching between the two on an existing PDB, disabled, unhealthyPodEvictionPolicy passthrough, and CEL rejection of both fields and of selector. Also added validation unit tests.
  • make test, make lint and make gosec pass.

Add an optional podDisruptionBudget field with minAvailable and
maxUnavailable to spec.bindplane, spec.opamp, spec.nats and
spec.transformAgent. A CEL rule and the shared validation package reject
specs that set both. When the field is unset the operator keeps the
current minAvailable: 1 budget, and disablePodDisruptionBudget still
removes the PDB.
@joe-armstrong
joe-armstrong marked this pull request as ready for review September 24, 2026 15:35
@jsirianni jsirianni self-assigned this Sep 24, 2026
Comment thread api/v1alpha1/bindplane_types.go Resolved
Comment thread docs/configuration/api.md Resolved
Replace the custom PodDisruptionBudgetSpec with the upstream
k8s.io/api/policy/v1 type. The operator still sets the selector, and a CEL
rule rejects specs that set it. unhealthyPodEvictionPolicy is now passed
through to the managed PDB.
@joe-armstrong
joe-armstrong added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 1496ad1 Sep 24, 2026
21 checks passed
@joe-armstrong
joe-armstrong deleted the joe-armstrong/configurable-pdb branch September 24, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants