feat(charts): support topologySpreadConstraints on every deployment - #210
Merged
Conversation
Add an optional topologySpreadConstraints value to every chart that renders a standard Kubernetes Deployment, alongside the existing nodeSelector, tolerations, and affinity scheduling fields. The value defaults to [] and is rendered only when non-empty, so existing manifests are unchanged. Affected charts: - lago-rails (api / clock / *-worker releases) - lago-front - lago-pdf (under .gotenberg.topologySpreadConstraints) - lago-mcp-server - lago-data-api - lago-data-worker - lago-events-processor-worker Also extend tests-common/deployment/common_patterns_test.yaml so every deployment chart that consumes the shared test suite asserts that topologySpreadConstraints render through to the pod spec. lago-data-rev-rec is intentionally skipped — it renders a FlinkDeployment (Flink operator CR), not a standard Deployment, and currently exposes no scheduling fields at all. Adding spread support there is a separate change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
topologySpreadConstraintsvalue to every chart that renders a standard Kubernetes Deployment, alongside the existingnodeSelector,tolerations, andaffinityfields. Defaults to[], rendered only when non-empty — existing manifests are unchanged.Affected charts:
lago-rails(api / clock / *-worker releases)lago-frontlago-pdf(under.gotenberg.topologySpreadConstraints)lago-mcp-serverlago-data-apilago-data-workerlago-events-processor-workerSkipped:
lago-data-rev-recrenders aFlinkDeployment(Flink operator CR), not a standard Deployment, and currently exposes no scheduling fields at all. Spread support there would land injobManager.podTemplate/taskManager.podTemplateseparately.Motivation
We need to spread the staging
mainapi's 3 replicas across 3 distinct nodes (to mimic production), andtopologySpreadConstraintsis the cleanest expression. Today onlyaffinity.podAntiAffinityworks (see lago-deploy#2097).Test plan
task test:unit— the sharedtests-common/deployment/common_patterns_test.yamlnow coverstopologySpreadConstraints; all 6 charts that consume it (rails, front, mcp-server, data-api, data-worker, events-processor-worker) pass with the new assertions.task lint:all— 14/14 charts lint successfully.affinity.podAntiAffinityblock inlago-deploy/staging/staging-main-values.yamlwithtopologySpreadConstraintsand confirm the 3 api pods land on 3 distinct nodes.