From 45c134cde6e74f3a62d23d3966d8156ecdf4c8ab Mon Sep 17 00:00:00 2001 From: Jared Schmidt <94077500+jared-schmidt-niceincontact@users.noreply.github.com> Date: Mon, 17 Oct 2022 14:51:09 -0600 Subject: [PATCH] Fixes topologySpreadConstraints (#59) * Fixes topologySpreadConstraints The topologySpreadConstraints were placed in the wrong spot. They are part of a pod spec. * Updates the minDomains Updates the minDomains to correctly match the default when unspecified. * Fixes indentation --- keydb/templates/sts.yaml | 40 ++++++++++++++++++++-------------------- keydb/values.yaml | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/keydb/templates/sts.yaml b/keydb/templates/sts.yaml index 41e5b6a..e8af8e8 100644 --- a/keydb/templates/sts.yaml +++ b/keydb/templates/sts.yaml @@ -14,26 +14,6 @@ spec: selector: matchLabels: {{- include "keydb.selectorLabels" . | nindent 6 }} - {{- if .Values.topologySpreadConstraints }} - topologySpreadConstraints: - {{- range .Values.topologySpreadConstraints }} - - labelSelector: - matchLabels: - {{- include "keydb.selectorLabels" $ | nindent 10 }} - topologyKey: {{ default "topology.kubernetes.io/zone" .topologyKey }} - maxSkew: {{ .maxSkew }} - {{- if .minDomains }} - minDomains: {{ .minDomains }} - {{- end }} - whenUnsatisfiable: {{ default "DoNotSchedule" .whenUnsatisfiable }} - {{- if .nodeAffinityPolicy }} - nodeAffinityPolicy: {{ .nodeAffinityPolicy }} - {{- end }} - {{- if .nodeTaintsPolicy }} - nodeTaintsPolicy: {{ .nodeTaintsPolicy }} - {{- end }} - {{- end }} - {{- end }} template: metadata: annotations: @@ -260,6 +240,26 @@ spec: nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- range .Values.topologySpreadConstraints }} + - labelSelector: + matchLabels: + {{- include "keydb.selectorLabels" $ | nindent 14 }} + topologyKey: {{ default "topology.kubernetes.io/zone" .topologyKey }} + maxSkew: {{ .maxSkew }} + {{- if .minDomains }} + minDomains: {{ .minDomains }} + {{- end }} + whenUnsatisfiable: {{ default "DoNotSchedule" .whenUnsatisfiable }} + {{- if .nodeAffinityPolicy }} + nodeAffinityPolicy: {{ .nodeAffinityPolicy }} + {{- end }} + {{- if .nodeTaintsPolicy }} + nodeTaintsPolicy: {{ .nodeTaintsPolicy }} + {{- end }} + {{- end }} + {{- end }} volumes: - name: health configMap: diff --git a/keydb/values.yaml b/keydb/values.yaml index 53b4ad6..1b10288 100644 --- a/keydb/values.yaml +++ b/keydb/values.yaml @@ -45,7 +45,7 @@ topologySpreadConstraints: [] # ## Optional keys # # whenUnsatisfiable: DoNotSchedule # # topologyKey: "topology.kubernetes.io/zone" -# # minDomains: 0 +# # minDomains: 1 # # nodeAffinityPolicy: Honor # # nodeTaintsPolicy: Honor