Skip to content

Commit

Permalink
Added scheduling.tolerations
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Aug 29, 2023
1 parent ee06bc9 commit fcc54ba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions charts/generic-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ app:
| `scheduling.nodeSelector` | `{}` | Labels to select nodes this service may be run on |
| `scheduling.nodePeferences` | `{}` | Sets of label values to select nodes this service should be run on if possible |
| `scheduling.nodeExclusions` | `{}` | Sets of label values to select nodes this service must not run on |
| `scheduling.tolerations` | `[]` | Taints on nodes this service can tolerate |
| `scheduling.podAffinity` | `{}` | Labels to select other pods this service should share nodes with if possible |
| `scheduling.podAntiAffinity` | `{}` | Labels to select other pods this service must not share nodes with |
| `scheduling.replicaSpread` | `BestEffort` | How to spread replicas across nodes (`BestEffort`, `Strict`, `None`) |
Expand Down
1 change: 1 addition & 0 deletions charts/generic-service/ci/scheduling-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ scheduling:
someKey: [someValue1, someValue2]
nodeExclusions:
otherKey: [otherValue1, otherValue2]
tolerations: [someTaint]
podAffinity:
someKey: someValue
podAntiAffinity:
Expand Down
8 changes: 5 additions & 3 deletions charts/generic-service/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ spec:

{{- if .Values.scheduling.nodeSelector }}
nodeSelector: {{- .Values.scheduling.nodeSelector | toYaml | nindent 8 }}
{{- end }}

{{- if .Values.scheduling.tolerations }}
tolerations:
{{- range $key, $val := .Values.scheduling.nodeSelector }}
{{- range $key:= .Values.scheduling.tolerations }}
- key: {{ $key | quote }}
operator: Equal
value: {{ $val | quote }}
operator: Exists
{{- end }}
{{- end }}

Expand Down
5 changes: 5 additions & 0 deletions charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@
},
"description": "Sets of label values to select nodes this service must not run on"
},
"tolerations": {
"type": "array",
"items": {"type": "string"},
"description": "Taints on nodes this service can tolerate"
},
"podAffinity": {
"type": "object",
"additionalProperties": {"type": "string"},
Expand Down
1 change: 1 addition & 0 deletions charts/generic-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ scheduling:
nodeSelector: {}
nodePreferences: {}
nodeExclusions: {}
tolerations: []
podAffinity: {}
podAntiAffinity: {}
replicaSpread: BestEffort
Expand Down

0 comments on commit fcc54ba

Please sign in to comment.