Skip to content

fix(helm): preserve zero PDB budgets and validate minAvailable/maxUnavailable - #106

Open
dimetron wants to merge 3 commits into
mainfrom
fix/helm-pdb-validation
Open

dimetron wants to merge 3 commits into
mainfrom
fix/helm-pdb-validation

Conversation

@dimetron

@dimetron dimetron commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #73 (includes its commit, rebased on main) and combines the best PDB patterns from kagent's own chart and istio.

Design

Concern Source Behaviour
Zero / empty handling kagent kagent-tools.pdb.isSet: null and "" are unset; 0 and percentages are kept
Both or neither set kagent kagent-tools.pdb.validate fails with an actionable message
Default budget kagent maxUnavailable: 1 when enabled (minAvailable: null)
Selector kagent reuses kagent-tools.selectorLabels (cannot drift from the Deployment)
Labels / annotations / unhealthyPodEvictionPolicy kagent optional, rendered via with
Replica guard istio only rendered when replicaCount > 1; a single-replica PDB protects nothing or blocks drains
Skipped-PDB feedback new config is still validated, and NOTES.txt warns when the PDB is skipped

Prior art (CNCF charts)

Chart Keeps 0 Both set Neither set Replica guard
kagent ✅ fail fail ❌
istio ❌ maxUnavailable wins not rendered ✅
argo-cd ✅ maxUnavailable wins minAvailable: 0 ❌
cert-manager ✅ renders both minAvailable: 1 ❌
ingress-nginx ❌ maxUnavailable wins not rendered ✅
kyverno ❌ fail minAvailable: 1 ✅

Testing

make helm-test — 36/36 passing; helm lint clean.

Relates to #73

anthonyhaussman and others added 2 commits November 11, 2026 23:42
Support custom deployment metadata annotations and
configurable PodDisruptionBudget for kagent-tools.

Assisted-by: Gemini 3.7 Flash
Signed-off-by: Anthony Hausman <anthonyhaussmann@gmail.com>
…vailable

Use hasKey so minAvailable/maxUnavailable of 0 are rendered, fail when
both or neither are set, and add unit tests for these cases.

Signed-off-by: Dmytro Rashko <dimetron@me.com>
- Add kagent-tools.pdb.isSet/validate helpers: null and "" are unset,
  0 and percentages are kept; both-set and neither-set fail with
  actionable messages (mirrors kagent's controller PDB).
- Default to maxUnavailable: 1 when enabled.
- Only render the PDB when replicaCount > 1 (istio pattern), still
  validating config, and warn in NOTES when it is skipped.
- Expand unit tests.

Signed-off-by: Dmytro Rashko <dimetron@me.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Deployment annotation and PodDisruptionBudget changes.

No open issues 🎉

What changed in this PR

Building on #73, this PR adds configurable Deployment annotations and PodDisruptionBudget support to the KAgent Tools Helm chart, preserving zero budgets and rejecting conflicting or missing budget settings.

Changes:

  • Adds optional PDB settings with a default maxUnavailable: 1 and selectors shared with the Deployment.
  • Validates enabled PDB configurations even when the replica guard skips creation, and warns users when skipped.
  • Adds Deployment annotations and unit tests for annotations, PDB rendering, zero budgets, and validation.
File Description
helm/​kagent-tools/​values.yaml Defines Deployment annotations and documented PDB defaults.
helm/​kagent-tools/​tests/​pdb_test.yaml Tests PDB rendering, zero budgets, optional metadata, and validation.
helm/​kagent-tools/​tests/​deployment_test.yaml Tests default and custom Deployment annotations.
helm/​kagent-tools/​templates/​pdb.yaml Renders the optional PDB using shared selectors.
helm/​kagent-tools/​templates/​NOTES.txt Warns when the replica guard skips an enabled PDB.
helm/​kagent-tools/​templates/​deployment.yaml Renders optional Deployment-level annotations.
helm/​kagent-tools/​templates/​_helpers.tpl Adds budget-presence, validation, and replica-guard helpers.

Review effort: Balanced

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.

4 participants