Skip to content

Commit 285d87b

Browse files
authored
Added scheduling parameters to helm template; (#249)
Issue #, if available: Closes [#1038](aws-controllers-k8s/community#1038) Description of changes: This adds affinity, toleration and priorityClassName to the deployment spec as optional parameters. They default to none, so this will not change any existing functionality. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5ffa7ae commit 285d87b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

templates/helm/templates/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,12 @@ spec:
7575
value: {{ join "," .Values.resourceTags | quote }}
7676
terminationGracePeriodSeconds: 10
7777
nodeSelector: {{ toYaml .Values.deployment.nodeSelector | nindent 8 }}
78+
{{ if .Values.deployment.tolerations -}}
79+
tolerations: {{ toYaml .Values.deployment.tolerations | nindent 8 }}
80+
{{ end -}}
81+
{{ if .Values.deployment.affinity -}}
82+
affinity: {{ toYaml .Values.deployment.affinity | nindent 8 }}
83+
{{ end -}}
84+
{{ if .Values.deployment.priorityClassName -}}
85+
priorityClassName: {{ .Values.deployment.priorityClassName -}}
86+
{{ end -}}

templates/helm/values.yaml.tpl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ deployment:
1515
annotations: {}
1616
labels: {}
1717
containerPort: 8080
18+
# Which nodeSelector to set?
19+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
1820
nodeSelector:
1921
kubernetes.io/os: linux
20-
22+
# Which tolerations to set?
23+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
24+
tolerations: {}
25+
# What affinity to set?
26+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
27+
affinity: {}
28+
# Which priorityClassName to set?
29+
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
30+
priorityClassName:
31+
2132
metrics:
2233
service:
2334
# Set to true to automatically create a Kubernetes Service resource for the

0 commit comments

Comments
 (0)