Skip to content

Commit 968bee7

Browse files
authored
add affinity to helm charts (#1851)
* add affinity to helm charts * update README.md file Fixes #1763
1 parent 2b97b69 commit 968bee7

10 files changed

+71
-18
lines changed

charts/selenium-grid/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ For now, global configuration supported is:
5454
| `global.seleniumGrid.imageTag` | `4.9.1-20230508` | Image tag for all selenium components |
5555
| `global.seleniumGrid.nodesImageTag` | `4.9.1-20230508` | Image tag for browser's nodes |
5656
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
57+
| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images |
58+
| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally |
5759

5860
This table contains the configuration parameters of the chart and their default values:
5961

@@ -84,6 +86,7 @@ This table contains the configuration parameters of the chart and their default
8486
| `chromeNode.securityContext` | `See values.yaml` | Security context for chrome-node pods |
8587
| `chromeNode.tolerations` | `[]` | Tolerations for chrome-node pods |
8688
| `chromeNode.nodeSelector` | `{}` | Node Selector for chrome-node pods |
89+
| `chromeNode.affinity` | `{}` | Affinity for chrome-node pods |
8790
| `chromeNode.hostAliases` | `nil` | Custom host aliases for chrome nodes |
8891
| `chromeNode.priorityClassName` | `""` | Priority class name for chrome-node pods |
8992
| `chromeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for chrome nodes |
@@ -113,6 +116,8 @@ This table contains the configuration parameters of the chart and their default
113116
| `firefoxNode.securityContext` | `See values.yaml` | Security context for firefox-node pods |
114117
| `firefoxNode.tolerations` | `[]` | Tolerations for firefox-node pods |
115118
| `firefoxNode.nodeSelector` | `{}` | Node Selector for firefox-node pods |
119+
| `firefoxNode.affinity` | `{}` | Affinity for
120+
firefox-node pods |
116121
| `firefoxNode.hostAliases` | `nil` | Custom host aliases for firefox nodes |
117122
| `firefoxNode.priorityClassName` | `""` | Priority class name for firefox-node pods |
118123
| `firefoxNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
@@ -142,6 +147,9 @@ This table contains the configuration parameters of the chart and their default
142147
| `edgeNode.securityContext` | `See values.yaml` | Security context for edge-node pods |
143148
| `edgeNode.tolerations` | `[]` | Tolerations for edge-node pods |
144149
| `edgeNode.nodeSelector` | `{}` | Node Selector for edge-node pods |
150+
| `edgeNode.affinity` | `{}` | Affinity for
151+
edge-node
152+
pods |
145153
| `edgeNode.hostAliases` | `nil` | Custom host aliases for edge nodes |
146154
| `edgeNode.priorityClassName` | `""` | Priority class name for edge-node pods |
147155
| `edgeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
@@ -177,6 +185,9 @@ You can configure the Selenium Hub with this values:
177185
| `hub.readinessProbe` | `See values.yaml` | Readiness probe settings |
178186
| `hub.tolerations` | `[]` | Tolerations for selenium-hub pods |
179187
| `hub.nodeSelector` | `{}` | Node Selector for selenium-hub pods |
188+
| `hub.affinity` | `{}` | Affinity for
189+
selenium-hub
190+
pods |
180191
| `hub.priorityClassName` | `""` | Priority class name for selenium-hub pods |
181192
| `hub.subPath` | `/` | Custom sub path for the hub deployment |
182193
| `hub.extraEnvironmentVariables` | `nil` | Custom environment variables for selenium-hub |
@@ -209,6 +220,9 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
209220
| `components.router.serviceAnnotations` | `{}` | Custom annotations for router service |
210221
| `components.router.tolerations` | `[]` | Tolerations for router pods |
211222
| `components.router.nodeSelector` | `{}` | Node Selector for router pods |
223+
| `components.router.affinity` | `{}` | Affinity for
224+
router
225+
pods |
212226
| `components.router.priorityClassName` | `""` | Priority class name for router pods |
213227
| `components.distributor.imageName` | `selenium/distributor` | Distributor image name |
214228
| `components.distributor.imageTag` | `nil` | Distributor image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
@@ -222,6 +236,9 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
222236
| `components.distributor.serviceAnnotations` | `{}` | Custom annotations for Distributor service |
223237
| `components.distributor.tolerations` | `[]` | Tolerations for Distributor pods |
224238
| `components.distributor.nodeSelector` | `{}` | Node Selector for Distributor pods |
239+
| `components.distributor.affinity` | `{}` | Affinity for
240+
Distributor
241+
pods |
225242
| `components.distributor.priorityClassName` | `""` | Priority class name for Distributor pods |
226243
| `components.eventBus.imageName` | `selenium/event-bus` | Event Bus image name |
227244
| `components.eventBus.imageTag` | `nil` | Event Bus image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
@@ -237,6 +254,9 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
237254
| `components.eventBus.serviceAnnotations` | `{}` | Custom annotations for Event Bus service |
238255
| `components.eventBus.tolerations` | `[]` | Tolerations for Event Bus pods |
239256
| `components.eventBus.nodeSelector` | `{}` | Node Selector for Event Bus pods |
257+
| `components.eventBus.affinity` | `{}` | Affinity for
258+
Event Bus
259+
pods |
240260
| `components.eventBus.priorityClassName` | `""` | Priority class name for Event Bus pods |
241261
| `components.sessionMap.imageName` | `selenium/sessions` | Session Map image name |
242262
| `components.sessionMap.imageTag` | `nil` | Session Map image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
@@ -249,6 +269,9 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
249269
| `components.sessionMap.serviceAnnotations` | `{}` | Custom annotations for Session Map service |
250270
| `components.sessionMap.tolerations` | `[]` | Tolerations for Session Map pods |
251271
| `components.sessionMap.nodeSelector` | `{}` | Node Selector for Session Map pods |
272+
| `components.sessionMap.affinity` | `{}` | Affinity for
273+
Session Map
274+
pods |
252275
| `components.sessionMap.priorityClassName` | `""` | Priority class name for Session Map pods |
253276
| `components.sessionQueue.imageName` | `selenium/session-queue` | Session Queue image name |
254277
| `components.sessionQueue.imageTag` | `nil` | Session Queue image tag (this overwrites `.global.seleniumGrid.imageTag` value) |
@@ -262,6 +285,9 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
262285
| `components.sessionQueue.serviceAnnotations` | `{}` | Custom annotations for Session Queue service |
263286
| `components.sessionQueue.tolerations` | `[]` | Tolerations for Session Queue pods |
264287
| `components.sessionQueue.nodeSelector` | `{}` | Node Selector for Session Queue pods |
288+
| `components.sessionQueue.affinity` | `{}` | Affinity for
289+
Session Queue
290+
pods |
265291
| `components.sessionQueue.priorityClassName` | `""` | Priority class name for Session Queue pods |
266292
| `components.subPath` | `/` | Custom sub path for all components |
267293
| `components.extraEnvironmentVariables` | `nil` | Custom environment variables for all components |

charts/selenium-grid/templates/chrome-node-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ spec:
7878
{{- with .Values.chromeNode.nodeSelector }}
7979
nodeSelector: {{- toYaml . | nindent 8 }}
8080
{{- end }}
81+
{{- if or .Values.global.seleniumGrid.affinity .Values.chromeNode.affinity }}
82+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.chromeNode.affinity }}
83+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
84+
{{- end }}
8185
{{- with .Values.chromeNode.tolerations }}
82-
tolerations:
83-
{{ toYaml . | nindent 6 }}
86+
tolerations: {{ toYaml . | nindent 6 }}
8487
{{- end }}
8588
{{- with .Values.chromeNode.priorityClassName }}
8689
priorityClassName: {{ . }}

charts/selenium-grid/templates/distributor-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ spec:
6363
{{- with .Values.components.distributor.nodeSelector }}
6464
nodeSelector: {{- toYaml . | nindent 8 }}
6565
{{- end }}
66+
{{- if or .Values.global.seleniumGrid.affinity .Values.components.distributor.affinity }}
67+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.components.distributor.affinity }}
68+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
69+
{{- end }}
6670
{{- with .Values.components.distributor.tolerations }}
67-
tolerations:
68-
{{ toYaml . | nindent 6 }}
71+
tolerations: {{ toYaml . | nindent 6 }}
6972
{{- end }}
7073
{{- with .Values.components.distributor.priorityClassName }}
7174
priorityClassName: {{ . }}

charts/selenium-grid/templates/edge-node-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ spec:
7474
{{- with .Values.edgeNode.nodeSelector }}
7575
nodeSelector: {{- toYaml . | nindent 8 }}
7676
{{- end }}
77+
{{- if or .Values.global.seleniumGrid.affinity .Values.edgeNode.affinity }}
78+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.edgeNode.affinity }}
79+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
80+
{{- end }}
7781
{{- with .Values.edgeNode.tolerations }}
78-
tolerations:
79-
{{ toYaml . | nindent 6 }}
82+
tolerations: {{ toYaml . | nindent 6 }}
8083
{{- end }}
8184
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.edgeNode.imagePullSecret }}
8285
imagePullSecrets:

charts/selenium-grid/templates/event-bus-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ spec:
5252
{{- with .Values.components.eventBus.nodeSelector }}
5353
nodeSelector: {{- toYaml . | nindent 8 }}
5454
{{- end }}
55+
{{- if or .Values.global.seleniumGrid.affinity .Values.components.eventBus.affinity }}
56+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.components.eventBus.affinity }}
57+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
58+
{{- end }}
5559
{{- with .Values.components.eventBus.tolerations }}
56-
tolerations:
57-
{{ toYaml . | nindent 6 }}
60+
tolerations: {{ toYaml . | nindent 6 }}
5861
{{- end }}
5962
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.components.eventBus.imagePullSecret }}
6063
imagePullSecrets:

charts/selenium-grid/templates/firefox-node-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ spec:
7474
{{- with .Values.firefoxNode.nodeSelector }}
7575
nodeSelector: {{- toYaml . | nindent 8 }}
7676
{{- end }}
77+
{{- if or .Values.global.seleniumGrid.affinity .Values.firefoxNode.affinity }}
78+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.firefoxNode.affinity }}
79+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
80+
{{- end }}
7781
{{- with .Values.firefoxNode.tolerations }}
78-
tolerations:
79-
{{ toYaml . | nindent 6 }}
82+
tolerations: {{ toYaml . | nindent 6 }}
8083
{{- end }}
8184
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.firefoxNode.imagePullSecret }}
8285
imagePullSecrets:

charts/selenium-grid/templates/hub-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ spec:
8080
{{- with .Values.hub.nodeSelector }}
8181
nodeSelector: {{- toYaml . | nindent 8 }}
8282
{{- end }}
83+
{{- if or .Values.global.seleniumGrid.affinity .Values.hub.affinity }}
84+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.hub.affinity }}
85+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
86+
{{- end }}
8387
{{- with .Values.hub.tolerations }}
84-
tolerations:
85-
{{ toYaml . | nindent 6 }}
88+
tolerations: {{ toYaml . | nindent 6 }}
8689
{{- end }}
8790
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.hub.imagePullSecret }}
8891
imagePullSecrets:

charts/selenium-grid/templates/router-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ spec:
8585
{{- with .Values.components.router.nodeSelector }}
8686
nodeSelector: {{- toYaml . | nindent 8 }}
8787
{{- end }}
88+
{{- if or .Values.global.seleniumGrid.affinity .Values.components.router.affinity }}
89+
{{- $affinityYaml := default .Values.global.seleniumGrid.affinity .Values.components.router.affinity }}
90+
affinity: {{- toYaml $affinityYaml | nindent 8 }}
91+
{{- end }}
8892
{{- with .Values.components.router.tolerations }}
89-
tolerations:
90-
{{ toYaml . | nindent 6 }}
93+
tolerations: {{ toYaml . | nindent 6 }}
9194
{{- end }}
9295
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.components.router.imagePullSecret }}
9396
imagePullSecrets:

0 commit comments

Comments
 (0)