Repository navigation
fix(helm): preserve zero PDB budgets and validate minAvailable/maxUnavailable - #106
Conversation
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>
There was a problem hiding this comment.
🟢 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: 1and 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
|
LGTM. One optional UX thought below. Feel free to ignore it and merge as is. Because The main kagent chart,
I tried this locally with
istiod, argo-cd and ingress-nginx also accept either value on its own. Written by AI, reviewed by me. Once again this is just a nit. Given most users have access to agents these days, this is a very small item. |
Builds on #73 (includes its commit, rebased on
main) and combines the best PDB patterns from kagent's own chart and istio.Design
kagent-tools.pdb.isSet:nulland""are unset;0and percentages are keptkagent-tools.pdb.validatefails with an actionable messagemaxUnavailable: 1when enabled (minAvailable: null)kagent-tools.selectorLabels(cannot drift from the Deployment)unhealthyPodEvictionPolicywithreplicaCount > 1; a single-replica PDB protects nothing or blocks drainsNOTES.txtwarns when the PDB is skippedPrior art (CNCF charts)
0maxUnavailablewinsmaxUnavailablewinsminAvailable: 0minAvailable: 1maxUnavailablewinsminAvailable: 1Testing
make helm-test— 36/36 passing;helm lintclean.Relates to #73