Skip to content

feat(helm): add PodDisruptionBudget for controller and UI - #2392

Open
anthonyhaussman wants to merge 1 commit into
kagent-dev:mainfrom
anthonyhaussman:feat/helm-poddisruptionbudget
Open

feat(helm): add PodDisruptionBudget for controller and UI#2392
anthonyhaussman wants to merge 1 commit into
kagent-dev:mainfrom
anthonyhaussman:feat/helm-poddisruptionbudget

Conversation

@anthonyhaussman

@anthonyhaussman anthonyhaussman commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Adds an opt-in PodDisruptionBudget for the controller and UI Deployments, configured per component via controller.pdb and ui.pdb.

controller:
  pdb:
    enabled: false
    minAvailable: null
    maxUnavailable: 1
    unhealthyPodEvictionPolicy: ""
    labels: {}
    annotations: {}

Why these defaults

Disabled by default. Both components default to replicas: 1, and a minAvailable: 1 budget on a single-replica Deployment refuses every voluntary eviction, so node drains and cluster upgrades hang. When enabled, the default is maxUnavailable: 1, which is safe at any replica count.

NOTES.txt warns at install time when minAvailable >= replicas, the configuration that deadlocks drains.

Selector correctness

The budget selector is rendered from kagent.<component>.selectorLabels, the same helper the Deployment spec.selector already uses. A budget whose selector does not match the Deployment silently protects nothing, so reusing the helper makes drift impossible rather than merely unlikely.

Validation

Kubernetes rejects a PDB with both minAvailable and maxUnavailable, and one with neither is meaningless. Both cases now fail at template time with a message naming the offending values path:

Error: execution error at (kagent/templates/ui-pdb.yaml:2:4): ui.pdb: minAvailable and
maxUnavailable are mutually exclusive. Set exactly one (to use minAvailable, set
ui.pdb.maxUnavailable=null).

The set/unset check uses kindIs "invalid" rather than default "", because Helm treats 0 as empty and would otherwise silently drop a maxUnavailable: 0 budget.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 4, 2026
@anthonyhaussman
anthonyhaussman marked this pull request as ready for review August 4, 2026 17:41
@anthonyhaussman
anthonyhaussman requested a review from a team as a code owner August 4, 2026 17:41
Opt-in per component via controller.pdb / ui.pdb. Disabled by
default because replicas is 1, where a minAvailable:1 budget
refuses every voluntary eviction and hangs node drains.

Selector reuses kagent.<component>.selectorLabels, the same helper
the Deployment spec.selector uses, so a budget cannot drift from
the pods it protects.

Setting both minAvailable and maxUnavailable, or neither, fails at
template time instead of surfacing as an opaque API server error.

Assisted-by: Claude Opus 5
Signed-off-by: Anthony Hausman <ahausman@tf1.fr>
@anthonyhaussman
anthonyhaussman force-pushed the feat/helm-poddisruptionbudget branch from bf8a604 to cec8f3f Compare August 5, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant