Skip to content

Commit

Permalink
add topologySpreadConstraints to Helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Davis <[email protected]>
  • Loading branch information
SgtCoDFish committed Jul 31, 2024
1 parent ae6e14e commit 5c9a4b4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deploy/charts/istio-csr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,25 @@ tolerations:
value: master
effect: NoSchedule
```
#### **topologySpreadConstraints** ~ `array`
> Default value:
> ```yaml
> []
> ```
List of Kubernetes TopologySpreadConstraints. For more information, see [TopologySpreadConstraint v1 core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#topologyspreadconstraint-v1-core).
For example:
```yaml
topologySpreadConstraints:
- maxSkew: 2
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: cert-manager-istio-csr
app.kubernetes.io/instance: istio-csr
```
#### **nodeSelector** ~ `object`
> Default value:
> ```yaml
Expand Down
4 changes: 4 additions & 0 deletions deploy/charts/istio-csr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ include "cert-manager-istio-csr.name" . }}
image: "{{ template "image" (tuple .Values.image $.Chart.AppVersion) }}"
Expand Down
9 changes: 9 additions & 0 deletions deploy/charts/istio-csr/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"tolerations": {
"$ref": "#/$defs/helm-values.tolerations"
},
"topologySpreadConstraints": {
"$ref": "#/$defs/helm-values.topologySpreadConstraints"
},
"volumeMounts": {
"$ref": "#/$defs/helm-values.volumeMounts"
},
Expand Down Expand Up @@ -598,6 +601,12 @@
"items": {},
"type": "array"
},
"helm-values.topologySpreadConstraints": {
"default": [],
"description": "List of Kubernetes TopologySpreadConstraints. For more information, see [TopologySpreadConstraint v1 core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#topologyspreadconstraint-v1-core).\nFor example:\ntopologySpreadConstraints:\n- maxSkew: 2\n topologyKey: topology.kubernetes.io/zone\n whenUnsatisfiable: ScheduleAnyway\n labelSelector:\n matchLabels:\n app.kubernetes.io/name: cert-manager-istio-csr\n app.kubernetes.io/instance: istio-csr",
"items": {},
"type": "array"
},
"helm-values.volumeMounts": {
"default": [],
"description": "Optional extra volume mounts. Useful for mounting custom root CAs\n\nFor example:\nvolumeMounts:\n- name: root-ca\n mountPath: /etc/tls",
Expand Down
12 changes: 12 additions & 0 deletions deploy/charts/istio-csr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ affinity: {}
# effect: NoSchedule
tolerations: []

# List of Kubernetes TopologySpreadConstraints. For more information, see [TopologySpreadConstraint v1 core](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#topologyspreadconstraint-v1-core).
# For example:
# topologySpreadConstraints:
# - maxSkew: 2
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: ScheduleAnyway
# labelSelector:
# matchLabels:
# app.kubernetes.io/name: cert-manager-istio-csr
# app.kubernetes.io/instance: istio-csr
topologySpreadConstraints: []

# Kubernetes node selector: node labels for pod assignment.
# +docs:property=nodeSelector
nodeSelector:
Expand Down

0 comments on commit 5c9a4b4

Please sign in to comment.