Skip to content

Commit 737c658

Browse files
authored
Merge pull request #145 from DrBu7cher/improve-topologyspreadconstraints-templating
feat(coredns,helmchart): template topologySpreadConstraints
2 parents badf60b + 6f7f11c commit 737c658

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

charts/coredns/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: coredns
3-
version: 1.27.1
3+
version: 1.28.0
44
appVersion: 1.11.1
55
home: https://coredns.io
66
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
@@ -20,5 +20,5 @@ engine: gotpl
2020
type: application
2121
annotations:
2222
artifacthub.io/changes: |
23-
- kind: fixed
24-
description: Fixed indentation for sidecar containers
23+
- kind: added
24+
description: topologySpreadConstraints can be templated values

charts/coredns/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ spec:
7373
{{- end }}
7474
{{- if .Values.topologySpreadConstraints }}
7575
topologySpreadConstraints:
76-
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
76+
{{ tpl (toYaml .Values.topologySpreadConstraints) $ | indent 8 }}
7777
{{- end }}
7878
{{- if .Values.tolerations }}
7979
tolerations:

charts/coredns/values.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,23 @@ readinessProbe:
181181
affinity: {}
182182

183183
# expects input structure as per specification https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#topologyspreadconstraint-v1-core
184-
# for example:
184+
# and supports Helm templating.
185+
# For example:
185186
# topologySpreadConstraints:
186-
# - maxSkew: 1
187-
# topologyKey: zone
188-
# whenUnsatisfiable: DoNotSchedule
189-
# labelSelector:
190-
# matchLabels:
191-
# foo: bar
187+
# - labelSelector:
188+
# matchLabels:
189+
# app.kubernetes.io/name: '{{ template "coredns.name" . }}'
190+
# app.kubernetes.io/instance: '{{ .Release.Name }}'
191+
# topologyKey: topology.kubernetes.io/zone
192+
# maxSkew: 1
193+
# whenUnsatisfiable: ScheduleAnyway
194+
# - labelSelector:
195+
# matchLabels:
196+
# app.kubernetes.io/name: '{{ template "coredns.name" . }}'
197+
# app.kubernetes.io/instance: '{{ .Release.Name }}'
198+
# topologyKey: kubernetes.io/hostname
199+
# maxSkew: 1
200+
# whenUnsatisfiable: ScheduleAnyway
192201
topologySpreadConstraints: []
193202

194203
# Node labels for pod assignment

0 commit comments

Comments
 (0)