Skip to content

Commit

Permalink
Merge pull request #145 from DrBu7cher/improve-topologyspreadconstrai…
Browse files Browse the repository at this point in the history
…nts-templating

feat(coredns,helmchart): template topologySpreadConstraints
  • Loading branch information
hagaibarel authored Nov 2, 2023
2 parents badf60b + 6f7f11c commit 737c658
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions charts/coredns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: coredns
version: 1.27.1
version: 1.28.0
appVersion: 1.11.1
home: https://coredns.io
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
Expand All @@ -20,5 +20,5 @@ engine: gotpl
type: application
annotations:
artifacthub.io/changes: |
- kind: fixed
description: Fixed indentation for sidecar containers
- kind: added
description: topologySpreadConstraints can be templated values
2 changes: 1 addition & 1 deletion charts/coredns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
{{- end }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{ tpl (toYaml .Values.topologySpreadConstraints) $ | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
Expand Down
23 changes: 16 additions & 7 deletions charts/coredns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,23 @@ readinessProbe:
affinity: {}

# expects input structure as per specification https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#topologyspreadconstraint-v1-core
# for example:
# and supports Helm templating.
# For example:
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: zone
# whenUnsatisfiable: DoNotSchedule
# labelSelector:
# matchLabels:
# foo: bar
# - labelSelector:
# matchLabels:
# app.kubernetes.io/name: '{{ template "coredns.name" . }}'
# app.kubernetes.io/instance: '{{ .Release.Name }}'
# topologyKey: topology.kubernetes.io/zone
# maxSkew: 1
# whenUnsatisfiable: ScheduleAnyway
# - labelSelector:
# matchLabels:
# app.kubernetes.io/name: '{{ template "coredns.name" . }}'
# app.kubernetes.io/instance: '{{ .Release.Name }}'
# topologyKey: kubernetes.io/hostname
# maxSkew: 1
# whenUnsatisfiable: ScheduleAnyway
topologySpreadConstraints: []

# Node labels for pod assignment
Expand Down

0 comments on commit 737c658

Please sign in to comment.