Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit 7942106

Browse files
authored
add global affinity,nodeSelector,podLabels and tolerations params to catalog chart (#2881)
1 parent aeb2f4d commit 7942106

File tree

8 files changed

+95
-11
lines changed

8 files changed

+95
-11
lines changed

charts/catalog/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: catalog
33
description: service-catalog webhook server and controller-manager helm chart
4-
version: 0.3.1
4+
version: 0.3.2

charts/catalog/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ chart and their default values.
7676
| `rbacEnable` | If true, create & use RBAC resources | `true` |
7777
| `originatingIdentityEnabled` | Whether the OriginatingIdentity feature should be enabled | `true` |
7878
| `persistence.storageClass` | Define the storageclass use by pvc | `null` |
79+
| `affinity` | Affinity settings ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)) | `{}` |
7980
| `asyncBindingOperationsEnabled` | Whether or not alpha support for async binding operations is enabled | `false` |
8081
| `namespacedServiceBrokerDisabled` | Whether or not alpha support for namespace scoped brokers is disabled | `false` |
82+
| `nodeSelector` | Node labels for pod assignment (global parameter for all pods) | `{}` |
83+
| `podLabels` | Additional pod labels to include for all pods | `{}` |
8184
| `priorityClassName` | Define PriorityClass for pods | "" |
85+
| `tolerations` | Tolerations for pod assignment | `[]` |
8286

8387
Specify each parameter using the `--set key=value[,key=value]` argument to
8488
`helm install`.

charts/catalog/templates/cleaner-job.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,18 @@ spec:
9090
template:
9191
metadata:
9292
labels:
93+
{{- if .Values.podLabels }}
94+
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
95+
{{- end }}
9396
cleaner-job: "true"
9497
app: {{ template "fullname" . }}-clean-job
9598
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9699
release: "{{ .Release.Name }}"
97100
heritage: "{{ .Release.Service }}"
98101
spec:
102+
{{- if .Values.priorityClassName }}
103+
priorityClassName: {{ .Values.priorityClassName | quote }}
104+
{{- end }}
99105
{{- with .Values.securityContext }}
100106
securityContext:
101107
{{ toYaml . | indent 8 }}
@@ -118,3 +124,14 @@ spec:
118124
- {{ template "fullname" . }}-controller-manager
119125
- --webhook-configurations
120126
- {{ template "fullname" . }}-webhook {{ template "fullname" . }}-validating-webhook
127+
{{- with .Values.affinity }}
128+
affinity: {{- tpl (toYaml .) $ | nindent 8 }}
129+
{{- end }}
130+
{{- with .Values.nodeSelector }}
131+
nodeSelector:
132+
{{ toYaml . | indent 8 }}
133+
{{- end }}
134+
{{- with .Values.tolerations }}
135+
tolerations:
136+
{{ toYaml . | indent 8 }}
137+
{{- end }}

charts/catalog/templates/controller-manager-deployment.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ spec:
1818
metadata:
1919
annotations:
2020
prometheus.io/scrape: "{{ .Values.controllerManager.enablePrometheusScrape }}"
21-
{{ if .Values.controllerManager.annotations }}
21+
{{- if .Values.controllerManager.annotations }}
2222
{{ toYaml .Values.controllerManager.annotations | indent 8 }}
2323
{{- end }}
2424
labels:
25+
{{- if .Values.podLabels }}
26+
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
27+
{{- end }}
2528
app: {{ template "fullname" . }}-controller-manager
2629
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
2730
release: "{{ .Release.Name }}"
@@ -131,7 +134,14 @@ spec:
131134
successThreshold: 1
132135
timeoutSeconds: 5
133136
{{- end }}
134-
{{ if .Values.controllerManager.nodeSelector }}
137+
{{- with .Values.affinity }}
138+
affinity: {{- tpl (toYaml .) $ | nindent 8 }}
139+
{{- end }}
140+
{{- if or .Values.controllerManager.nodeSelector .Values.nodeSelector }}
135141
nodeSelector:
136-
{{ toYaml .Values.controllerManager.nodeSelector | indent 8 }}
137-
{{ end }}
142+
{{ toYaml (mustMerge .Values.controllerManager.nodeSelector .Values.nodeSelector) | indent 8 }}
143+
{{- end }}
144+
{{- with .Values.tolerations }}
145+
tolerations:
146+
{{ toYaml . | indent 8 }}
147+
{{- end }}

charts/catalog/templates/migration-job.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,18 @@ spec:
106106
template:
107107
metadata:
108108
labels:
109+
{{- if .Values.podLabels }}
110+
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
111+
{{- end }}
109112
migration-job: "true"
110113
app: {{ template "fullname" . }}-migration-job
111114
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
112115
release: "{{ .Release.Name }}"
113116
heritage: "{{ .Release.Service }}"
114117
spec:
118+
{{- if .Values.priorityClassName }}
119+
priorityClassName: {{ .Values.priorityClassName | quote }}
120+
{{- end }}
115121
{{- with .Values.securityContext }}
116122
securityContext:
117123
{{ toYaml . | indent 8 }}
@@ -146,3 +152,14 @@ spec:
146152
volumeMounts:
147153
- name: storage
148154
mountPath: /data
155+
{{- with .Values.affinity }}
156+
affinity: {{- tpl (toYaml .) $ | nindent 8 }}
157+
{{- end }}
158+
{{- with .Values.nodeSelector }}
159+
nodeSelector:
160+
{{ toYaml . | indent 8 }}
161+
{{- end }}
162+
{{- with .Values.tolerations }}
163+
tolerations:
164+
{{ toYaml . | indent 8 }}
165+
{{- end }}

charts/catalog/templates/pre-migration-job.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,18 @@ spec:
120120
template:
121121
metadata:
122122
labels:
123+
{{- if .Values.podLabels }}
124+
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
125+
{{- end }}
123126
migration-job: "true"
124127
app: {{ template "fullname" . }}-pre-migration-job
125128
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
126129
release: "{{ .Release.Name }}"
127130
heritage: "{{ .Release.Service }}"
128131
spec:
132+
{{- if .Values.priorityClassName }}
133+
priorityClassName: {{ .Values.priorityClassName | quote }}
134+
{{- end }}
129135
{{- with .Values.securityContext }}
130136
securityContext:
131137
{{ toYaml . | indent 8 }}
@@ -156,3 +162,14 @@ spec:
156162
volumeMounts:
157163
- name: storage
158164
mountPath: /data
165+
{{- with .Values.affinity }}
166+
affinity: {{- tpl (toYaml .) $ | nindent 8 }}
167+
{{- end }}
168+
{{- with .Values.nodeSelector }}
169+
nodeSelector:
170+
{{ toYaml . | indent 8 }}
171+
{{- end }}
172+
{{- with .Values.tolerations }}
173+
tolerations:
174+
{{ toYaml . | indent 8 }}
175+
{{- end }}

charts/catalog/templates/webhook-deployment.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ spec:
1717
template:
1818
metadata:
1919
labels:
20+
{{- if .Values.podLabels }}
21+
{{- tpl (toYaml .Values.podLabels) $ | nindent 8 }}
22+
{{- end }}
2023
app: {{ template "fullname" . }}-webhook
2124
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
2225
release: "{{ .Release.Name }}"
2326
releaseRevision: "{{ .Release.Revision }}"
2427
heritage: "{{ .Release.Service }}"
25-
{{ if .Values.webhook.annotations }}
28+
{{- if .Values.webhook.annotations }}
2629
annotations:
2730
{{ toYaml .Values.webhook.annotations | indent 8 }}
2831
{{- end }}
@@ -87,10 +90,17 @@ spec:
8790
successThreshold: 1
8891
timeoutSeconds: 5
8992
{{- end }}
90-
{{ if .Values.webhook.nodeSelector }}
93+
{{- with .Values.affinity }}
94+
affinity: {{- tpl (toYaml .) $ | nindent 8 }}
95+
{{- end }}
96+
{{- if or .Values.webhook.nodeSelector .Values.nodeSelector }}
9197
nodeSelector:
92-
{{ toYaml .Values.webhook.nodeSelector | indent 8 }}
93-
{{ end }}
98+
{{ toYaml (mustMerge .Values.webhook.nodeSelector .Values.nodeSelector) | indent 8 }}
99+
{{- end }}
100+
{{- with .Values.tolerations }}
101+
tolerations:
102+
{{ toYaml . | indent 8 }}
103+
{{- end }}
94104
volumes:
95105
- name: service-catalog-webhook-cert
96106
secret:

charts/catalog/values.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ webhook:
2020
# annotations is a collection of annotations to add to the webhook pods.
2121
annotations: {}
2222
# nodeSelector to apply to the webhook pods
23-
nodeSelector:
23+
nodeSelector: {}
2424
# healthcheck configures the readiness and liveliness probes for the webhook pod.
2525
healthcheck:
2626
enabled: true
@@ -59,7 +59,7 @@ controllerManager:
5959
# annotations is a collection of annotations to add to the controllerManager pod.
6060
annotations: {}
6161
# nodeSelector to apply to the controllerManager pods
62-
nodeSelector:
62+
nodeSelector: {}
6363
# healthcheck configures the readiness and liveliness probes for the controllerManager pod.
6464
healthcheck:
6565
enabled: true
@@ -108,6 +108,9 @@ controllerManager:
108108
# Available port in allowable range (e.g. 30000 - 32767 on minikube)
109109
# The TLS-enabled endpoint will be exposed here
110110
securePort: 30444
111+
112+
affinity: {}
113+
111114
# Whether the OriginatingIdentity feature should be enabled
112115
originatingIdentityEnabled: true
113116
# Whether the AsyncBindingOperations alpha feature should be enabled
@@ -132,7 +135,13 @@ persistence:
132135
##
133136
storageClass:
134137

138+
nodeSelector: {}
139+
140+
podLabels: {}
141+
135142
# Leverage a PriorityClass to ensure your pods survive resource shortages
136143
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
137144
# PriorityClass: system-cluster-critical
138145
priorityClassName: ""
146+
147+
tolerations: []

0 commit comments

Comments
 (0)