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