feat(chart): add PodDisruptionBudget and topologySpreadConstraints support#5638
feat(chart): add PodDisruptionBudget and topologySpreadConstraints support#5638bafulton wants to merge 1 commit intoakuity:mainfrom
Conversation
✅ Deploy Preview for docs-kargo-io canceled.
|
|
Note that #5396 was not yet evaluated by any maintainers and remains in a proposal state, as indicated by its labels. We can take a look at this, but it's going to receive the scrutiny now that it should have received before anyone spent time implementing it. @hiddeco would you mind having a look at this, but only if you have the bandwidth? |
charts/kargo/values.yaml
Outdated
| ## @param global.topologySpreadConstraints Default topology spread constraints for all Kargo pods. | ||
| topologySpreadConstraints: [] |
There was a problem hiding this comment.
First of all, this PR is very well done. I love it.
This is the one thing I feel pretty hesitant about. Topology spread constraints would need to specify pod selectors and those would, for sure, vary from one component to the next, which I worry might make it impractical to ever have a global default.
There was a problem hiding this comment.
@krancour, fair callout. I've removed the global default.
There was a problem hiding this comment.
Feel free to take the branch over if there are other changes you want to make. I just wanted to get the ball rolling!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5638 +/- ##
=======================================
Coverage 56.42% 56.42%
=======================================
Files 458 458
Lines 38370 38370
=======================================
Hits 21650 21650
Misses 15442 15442
Partials 1278 1278 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c6216b2 to
d14e6e1
Compare
…pport
Add support for PodDisruptionBudgets and topology spread constraints
to enable robust high-availability deployments.
Changes:
- Add PDB templates for api, webhooksServer, and externalWebhooksServer
- Add topologySpreadConstraints to deployment templates (per-component only,
no global default since constraints require component-specific selectors)
- Add configuration options in values.yaml with sensible defaults
- Update README with new parameter documentation
For HA deployments, users can now:
- Enable PDBs to ensure availability during voluntary disruptions
- Configure topology spread constraints to distribute pods across zones
Example usage:
```yaml
api:
replicas: 2
podDisruptionBudget:
enabled: true
minAvailable: 1
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/component: api
```
Closes akuity#5396
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Ben Fulton <ben.fulton@semgrep.com>
d14e6e1 to
2f7aef1
Compare
| {{- with .Values.externalWebhooksServer.podDisruptionBudget.minAvailable }} | ||
| minAvailable: {{ . }} | ||
| {{- end }} | ||
| {{- with .Values.externalWebhooksServer.podDisruptionBudget.maxUnavailable }} | ||
| maxUnavailable: {{ . }} | ||
| {{- end }} |
There was a problem hiding this comment.
Since minAvailable defaults to 1, a user who sets maxUnavailable: 1 without also clearing minAvailable e.g. minAvailable: "" will get both fields rendered; which is invalid.
I think we can solve for this by checking if maxUnavailable is set and render it if it is. If not, fallback to maxUnavailable.
Applies in other locations as well.
Summary
Adds support for PodDisruptionBudgets and topology spread constraints to enable robust high-availability deployments.
Closes #5396
Changes
Usage Example
Test Plan
helm lintpasses