Skip to content

feat(helm): support revision-aware topology spread constraints - #75

Merged
pando85 merged 2 commits into
masterfrom
feat/helm-topology-spread-constraints
Oct 13, 2026
Merged

pando85 merged 2 commits into
masterfrom
feat/helm-topology-spread-constraints

Conversation

@pando85

@pando85 pando85 commented Oct 13, 2026

Copy link
Copy Markdown

Summary

  • Expose native topologySpreadConstraints in the Helm Deployment pod template with backward-compatible [] default.
  • Support an optional strategy override (defaulting to Kubernetes behavior), allowing a delete-first initial migration from required anti-affinity on a saturated cluster.
  • Replace the README HA example with revision-scoped hostname spreading using matchLabelKeys: [pod-template-hash].
  • Add Helm unit tests for default omission, revision-aware topology spread, coexistence with affinity, and migration rollout strategy.

Why

Required pod anti-affinity is enforced in both directions: old RobotLB pods can reject incoming pods regardless of their pod-template-hash. Topology spread provides per-revision scheduling, so updated replicas can share nodes with the old revision. The first rollout still needs to account for old hard anti-affinity rules, hence the optional rollout strategy.

Verification

  • Added four helm-unittest cases, executed by the existing helm-unittest CI job.
  • No chart or app version bump; release versioning remains separate.

Upgrade note

On a 3-node/3-replica cluster currently using required anti-affinity, remove affinity.podAntiAffinity, set topologySpreadConstraints as documented, and temporarily set strategy.rollingUpdate.maxSurge: 0 and maxUnavailable: 1. Restore Kubernetes default strategy after all old pods have terminated.

@pando85
pando85 merged commit e382a87 into master Oct 13, 2026
3 checks passed
@pando85
pando85 deleted the feat/helm-topology-spread-constraints branch October 13, 2026 22:31
@pando85 pando85 mentioned this pull request Oct 13, 2026
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.

1 participant