Add tolerations customization interface for service operators#1550
Conversation
Adds ability for service operators to customize pod tolerations similar
to how resource limits/requests are currently handled.
Features:
- Add Tolerations field to ContainerSpec API type
- Implement merge behavior: custom tolerations are merged with defaults,
overriding by key when same key exists
- Set global default tolerations (node.kubernetes.io/not-ready and
node.kubernetes.io/unreachable with 120s timeout) in controller
- Update deployment templates (managers.yaml, operator.yaml) to render
custom tolerations from Deployment struct
- Add test coverage for merge logic and override behavior
Example usage:
```yaml
operatorOverrides:
- name: "keystone"
controllerManager:
tolerations:
- key: "node.kubernetes.io/not-ready" # Override default timeout
operator: "Exists"
effect: "NoExecute"
tolerationSeconds: 600
- key: "node.example.com/gpu" # Add new toleration
operator: "Equal"
value: "nvidia"
effect: "NoSchedule"
```
The merge behavior ensures operators get both default tolerations
(unless overridden by matching key) plus any additional custom ones,
providing flexibility while maintaining safe defaults.
Jira: OSPRH-18693
Assisted-by: claude-4-sonnet
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abays, stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/43a1fc26b3754b65840bf7c6e890664e ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 50m 18s |
|
recheck |
|
/cherry-pick 18.0.fr3 |
|
@stuggi: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
06610ad
into
openstack-k8s-operators:main
|
@stuggi: cannot checkout DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/cherry-pick 18.0-fr3 |
|
@stuggi: new pull request created: #1551 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Adds ability for service operators to customize pod tolerations similar to how resource limits/requests are currently handled.
Features:
Example usage:
The merge behavior ensures operators get both default tolerations (unless overridden by matching key) plus any additional custom ones, providing flexibility while maintaining safe defaults.
Assisted-by: claude-4-sonnet
Jira: OSPRH-18693