Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion charts/generic-service/ci/scheduling-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ scheduling:
someKey: [someValue1, someValue2]
nodeExclusions:
otherKey: [otherValue1, otherValue2]
tolerations: [someTaint]
tolerations:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tolerations:
tolerations:

- taint1
- key: taint2
operator: Equal
value: "value1"
effect: NoSchedule
- key: taint2
operator: Exists
effect: NoSchedule
podAffinity:
someKey: someValue
podAntiAffinity:
Expand Down
16 changes: 14 additions & 2 deletions charts/generic-service/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,21 @@ spec:

{{- with .Values.scheduling.tolerations }}
tolerations:
{{- range $key:= . }}
- key: {{ $key | quote }}
{{- range . }}
{{- if kindIs "string" . }}
- key: {{ . | quote }}
operator: Exists
{{- else }}
{{- $toleration := . }}
- key: {{ $toleration.key | quote }}
operator: {{ $toleration.operator | default "Exists" | quote }}
{{- if $toleration.value }}
value: {{ $toleration.value | quote }}
{{- end }}
{{- if $toleration.effect }}
effect: {{ $toleration.effect | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

Expand Down
41 changes: 40 additions & 1 deletion charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,46 @@
"tolerations": {
"type": "array",
"items": {
"type": "string"
"type": "object",
"oneOf": [
{
"type": "object",
"properties": {
"operator": {
"type": [
"string",
"null"
],
"description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category."
},
"value": {
"type": [
"string",
"null"
],
"description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string."
},
"effect": {
"type": [
"string",
"null"
],
"description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute."
},
"key": {
"type": [
"string",
"null"
],
"description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys."
}
}
},
{
"type": "string",
"description": "Key of the taint. The operator is automatically set to Exists and the other fields would be set to null."
}
]
},
"description": "Taints on nodes this service can tolerate"
},
Expand Down
7 changes: 7 additions & 0 deletions charts/generic-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ scheduling:
nodePreferences: {}
nodeExclusions: {}
tolerations: []
## Example:
## tolerations: ["node.deepl.dev/k8s-kubevirt"]
## Or you can add more complex tolerations as objects here
## tolerations:
## - key: "node.deepl.dev/k8s-gpu-worker"
## effect: NoSchedule
## value: "true"
Comment on lines +90 to +96
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have examples for any of the other values in values.yaml either.

Suggested change
## Example:
## tolerations: ["node.deepl.dev/k8s-kubevirt"]
## Or you can add more complex tolerations as objects here
## tolerations:
## - key: "node.deepl.dev/k8s-gpu-worker"
## effect: NoSchedule
## value: "true"

Perhaps we can put this in the README.md instead?

Perhaps something like:

| `scheduling.tolerations` | `[]`  | Taints on nodes this service can tolerate as strings or complex tolerations as objects |

podAffinity: {}
podAntiAffinity: {}
replicaSpread: BestEffort
Expand Down
Loading