Skip to content

Commit

Permalink
feat(helm): add topologySpread to controller (#2206)
Browse files Browse the repository at this point in the history
add controllerManager.topologySpreadConstraints

Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>

Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
  • Loading branch information
stek29 and ritazh committed Jul 30, 2022
1 parent 46547db commit c6be42f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/build/helmify/kustomize-for-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ spec:
HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_POD_SECURITY_CONTEXT: ""
affinity:
HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_AFFINITY: ""
topologySpreadConstraints:
HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_TOPOLOGY_SPREAD_CONSTRAINTS: ""
tolerations:
HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_TOLERATIONS: ""
imagePullSecrets:
Expand Down
2 changes: 2 additions & 0 deletions cmd/build/helmify/replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ var replacements = map[string]string{

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_TOLERATIONS: ""`: `{{- toYaml .Values.controllerManager.tolerations | nindent 8 }}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_TOPOLOGY_SPREAD_CONSTRAINTS: ""`: `{{- toYaml .Values.controllerManager.topologySpreadConstraints | nindent 8 }}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_IMAGE_PULL_SECRETS: ""`: `{{- toYaml .Values.image.pullSecrets | nindent 8 }}`,

"HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_PRIORITY_CLASS_NAME": `{{ .Values.controllerManager.priorityClassName }}`,
Expand Down
1 change: 1 addition & 0 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| resources | The resource request/limits for the container image | limits: 1 CPU, 512Mi, requests: 100mCPU, 256Mi |
| nodeSelector | The node selector to use for pod scheduling | `kubernetes.io/os: linux` |
| affinity | The node affinity to use for pod scheduling | `{}` |
| topologySpreadConstraints | The topology spread constraints to use for pod scheduling | `[]` |
| tolerations | The tolerations to use for pod scheduling | `[]` |
| controllerManager.healthPort | Health port for controller manager | `9090` |
| controllerManager.port | Webhook-server port for controller manager | `8443` |
Expand Down
1 change: 1 addition & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ controllerManager:
- webhook
topologyKey: kubernetes.io/hostname
weight: 100
topologySpreadConstraints: []
tolerations: []
nodeSelector: {kubernetes.io/os: linux}
resources:
Expand Down
1 change: 1 addition & 0 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi
| resources | The resource request/limits for the container image | limits: 1 CPU, 512Mi, requests: 100mCPU, 256Mi |
| nodeSelector | The node selector to use for pod scheduling | `kubernetes.io/os: linux` |
| affinity | The node affinity to use for pod scheduling | `{}` |
| topologySpreadConstraints | The topology spread constraints to use for pod scheduling | `[]` |
| tolerations | The tolerations to use for pod scheduling | `[]` |
| controllerManager.healthPort | Health port for controller manager | `9090` |
| controllerManager.port | Webhook-server port for controller manager | `8443` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ spec:
terminationGracePeriodSeconds: 60
tolerations:
{{- toYaml .Values.controllerManager.tolerations | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.controllerManager.topologySpreadConstraints | nindent 8 }}
volumes:
- name: cert
secret:
Expand Down
1 change: 1 addition & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ controllerManager:
- webhook
topologyKey: kubernetes.io/hostname
weight: 100
topologySpreadConstraints: []
tolerations: []
nodeSelector: {kubernetes.io/os: linux}
resources:
Expand Down

0 comments on commit c6be42f

Please sign in to comment.