Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Fixes topologySpreadConstraints (#59)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jared-schmidt-niceincontact authored Oct 17, 2022
1 parent 7a430f3 commit 45c134c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions keydb/templates/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion keydb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ topologySpreadConstraints: []
# ## Optional keys
# # whenUnsatisfiable: DoNotSchedule
# # topologyKey: "topology.kubernetes.io/zone"
# # minDomains: 0
# # minDomains: 1
# # nodeAffinityPolicy: Honor
# # nodeTaintsPolicy: Honor

Expand Down

0 comments on commit 45c134c

Please sign in to comment.