feat!(kubernetes): add fine grained pod scheduling configurations with nodeSelector, tolerations, and affinity #6658
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds configurable Kubernetes pod scheduling support to the Loculus Helm chart so operators can control placement via node selectors, tolerations, and affinity.
Changes:
- Introduces
nodeSelector,tolerations, andaffinityvalues (with schema entries) for chart-wide pod scheduling. - Adds a shared Helm template helper (
loculus.podScheduling) and wires it into multiple workloads’ pod specs.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| kubernetes/loculus/values.yaml | Adds default/suggested pod scheduling values and a brief comment. |
| kubernetes/loculus/values.schema.json | Defines schema/validation for the new scheduling values. |
| kubernetes/loculus/templates/_pod-scheduling.tpl | Adds reusable helper to render nodeSelector/tolerations/affinity blocks. |
| kubernetes/loculus/templates/taxonomy-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/silo-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/minio-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/loculus-website.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/loculus-preprocessing-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/loculus-database-standin.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/loculus-backend.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/lapis-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/keycloak-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/keycloak-database-standin.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/ena-submission-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/docs-preview.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/autoapprove-deployment.yaml | Injects shared pod scheduling block into pod spec. |
| kubernetes/loculus/templates/_ingest-pod-spec.tpl | Injects shared pod scheduling block into ingest job pod spec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ed under general podScheduling key including podPriorityValue
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ae7eb04d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@claude review |
|
Claude finished @theosanderson's task in 2m 32s —— View job Code Review
Overall this is a clean, well-structured implementation. The helper template approach avoids repetition nicely, and the grouping under Critical: Missing
|
…plates & fixed the yaml indentation in the `_pod-scheduling.tpl` file
|
Included the podScheduling block to the last two pod specs as suggested, all pods should now schedule correctly. |
theosanderson
left a comment
There was a problem hiding this comment.
LGTM and CI passes in #6665, thanks
As briefly discussed on Slack.
This PR adds the
podSchedulingroot-level configuration property in the helm chart with three new child properties for kubernetes pod scheduling control;nodeSelector(object): maps the Loculus pod deployment directly to a Kubernetes node with a defined label for placementtolerations(array): allows pods to bypass specific node taintsaffinity(object): allows for the addition of fine grained affinity rules such as nodeAffinity or podAffinity as well as conditional scheduling.Additionally moved the
podPriorityValuekey from a root property to be grouped underneath thepodSchedulingkey.Example
This assumes a cluster is already created either in kubernetes or locally through k3s.
kubectl get nodeskubectl label nodes my-nodepool workload-type=my-custom-labelkubectl taint nodes my-nodepool workload-type=my-custom-label:NoSchedulewhen deploying, all Loculus pods will now schedule on the node named
my-nodepoolbecause it matches the assigned labelmy-custom-labelin the affinity rules. The tolerations rule states that the Loculus pods are allowed on this label while any other pod without this tolerations rule won't be allowed on this node during scheduling.If a more direct mapping is desired then this can be achieved the yaml example below, but this will not allow for more fine-grained control which is probably desired in production-like kubernetes clusters
Breaking changes
Need to move
podPriorityValueif set, to be underpodScheduling🚀 Preview: Add
previewlabel to enable