Skip to content

Commit 325307a

Browse files
committed
K8s: Configs extraEnvironmentVariables, extraEnvFrom in each distributed component
Support #2528 Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 2d80c88 commit 325307a

9 files changed

+137
-47
lines changed

Diff for: charts/selenium-grid/CONFIGURATION.md

+25-15
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
174174
| components.router.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
175175
| components.router.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
176176
| components.router.disableUI | bool | `false` | Disable the Grid UI |
177+
| components.router.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Router |
178+
| components.router.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Router |
177179
| components.router.affinity | object | `{}` | Specify affinity for router pods, this overwrites global.seleniumGrid.affinity parameter |
178180
| components.router.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for router pods, this overwrites global.seleniumGrid.topologySpreadConstraints parameter |
179181
| components.router.annotations | object | `{}` | Custom annotations for router pods |
@@ -198,6 +200,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
198200
| components.distributor.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
199201
| components.distributor.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
200202
| components.distributor.newSessionThreadPoolSize | string | `nil` | Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue |
203+
| components.distributor.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Distributor |
204+
| components.distributor.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Distributor |
201205
| components.distributor.affinity | object | `{}` | Specify affinity for distributor pods, this overwrites global.seleniumGrid.affinity parameter |
202206
| components.distributor.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for Distributor pods, this overwrites global.seleniumGrid.topologySpreadConstraints parameter |
203207
| components.distributor.annotations | object | `{}` | Custom annotations for Distributor pods |
@@ -218,6 +222,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
218222
| components.eventBus.imageTag | string | `nil` | Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) |
219223
| components.eventBus.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
220224
| components.eventBus.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
225+
| components.eventBus.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Event Bus |
226+
| components.eventBus.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Event Bus |
221227
| components.eventBus.affinity | object | `{}` | Specify affinity for Event Bus pods, this overwrites global.seleniumGrid.affinity parameter |
222228
| components.eventBus.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for Event Bus pods, this overwrites global.seleniumGrid.topologySpreadConstraints parameter |
223229
| components.eventBus.annotations | object | `{}` | Custom annotations for Event Bus pods |
@@ -242,6 +248,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
242248
| components.sessionMap.imageTag | string | `nil` | Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) |
243249
| components.sessionMap.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
244250
| components.sessionMap.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
251+
| components.sessionMap.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Session Map |
252+
| components.sessionMap.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Session Map |
245253
| components.sessionMap.affinity | object | `{}` | Specify affinity for Session Map pods, this overwrites global.seleniumGrid.affinity parameter |
246254
| components.sessionMap.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for Session Map pods, this overwrites global.seleniumGrid.topologySpreadConstraints parameter |
247255
| components.sessionMap.annotations | object | `{}` | Custom annotations for Session Map pods |
@@ -262,6 +270,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
262270
| components.sessionQueue.imageTag | string | `nil` | Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) |
263271
| components.sessionQueue.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
264272
| components.sessionQueue.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
273+
| components.sessionQueue.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Session Queue |
274+
| components.sessionQueue.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Session Queue |
265275
| components.sessionQueue.affinity | object | `{}` | Specify affinity for Session Queue pods, this overwrites global.seleniumGrid.affinity parameter |
266276
| components.sessionQueue.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for Session Queue pods, this overwrites global.seleniumGrid.topologySpreadConstraints parameter |
267277
| components.sessionQueue.annotations | object | `{}` | Custom annotations for Session Queue pods |
@@ -275,8 +285,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
275285
| components.sessionQueue.nodeSelector | object | `{}` | Node selector for Session Queue pods |
276286
| components.sessionQueue.priorityClassName | string | `""` | Priority class name for Session Queue pods |
277287
| components.subPath | string | `""` | Custom sub path for all components |
278-
| components.extraEnvironmentVariables | string | `nil` | Custom environment variables for all components |
279-
| components.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for all components |
288+
| components.extraEnvironmentVariables | list | `[]` | Custom environment variables for all components |
289+
| components.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for all components |
280290
| hub.imageRegistry | string | `nil` | Registry to pull the image (this overwrites global.seleniumGrid.imageRegistry parameter) |
281291
| hub.imageName | string | `"hub"` | Selenium Hub image name |
282292
| hub.imageTag | string | `nil` | Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) |
@@ -298,8 +308,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
298308
| hub.readinessProbe | object | `{"enabled":true,"failureThreshold":10,"initialDelaySeconds":12,"path":"/readyz","periodSeconds":10,"successThreshold":1,"timeoutSeconds":10}` | Readiness probe settings |
299309
| hub.livenessProbe | object | `{"enabled":true,"failureThreshold":30,"initialDelaySeconds":60,"path":"/readyz","periodSeconds":60,"successThreshold":1,"timeoutSeconds":60}` | Liveness probe settings |
300310
| hub.subPath | string | `""` | Custom sub path for the hub deployment |
301-
| hub.extraEnvironmentVariables | string | `nil` | Custom environment variables for selenium-hub |
302-
| hub.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for selenium-hub |
311+
| hub.extraEnvironmentVariables | list | `[]` | Custom environment variables for selenium-hub |
312+
| hub.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for selenium-hub |
303313
| hub.extraVolumeMounts | list | `[]` | Extra volume mounts for selenium-hub container |
304314
| hub.extraVolumes | list | `[]` | Extra volumes for selenium-hub pod |
305315
| hub.resources | object | `{}` | Resources for selenium-hub container |
@@ -392,8 +402,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
392402
| chromeNode.tolerations | list | `[]` | Tolerations for chrome-node pods |
393403
| chromeNode.nodeSelector | object | `{}` | Node selector for chrome-node pods |
394404
| chromeNode.hostAliases | string | `nil` | Custom host aliases for chrome nodes |
395-
| chromeNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for chrome nodes |
396-
| chromeNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for chrome nodes |
405+
| chromeNode.extraEnvironmentVariables | list | `[]` | Custom environment variables for chrome nodes |
406+
| chromeNode.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for chrome nodes |
397407
| chromeNode.service.enabled | bool | `false` | Create a service for node |
398408
| chromeNode.service.type | string | `"ClusterIP"` | Service type |
399409
| chromeNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
@@ -444,8 +454,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
444454
| firefoxNode.resources.limits | object | `{"cpu":"1","memory":"2Gi"}` | Limit resources for firefox-node pods |
445455
| firefoxNode.securityContext | object | `{}` | SecurityContext for firefox-node container |
446456
| firefoxNode.hostAliases | string | `nil` | Custom host aliases for firefox nodes |
447-
| firefoxNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for firefox nodes |
448-
| firefoxNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for firefox nodes |
457+
| firefoxNode.extraEnvironmentVariables | list | `[]` | Custom environment variables for firefox nodes |
458+
| firefoxNode.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for firefox nodes |
449459
| firefoxNode.service.enabled | bool | `false` | Create a service for node |
450460
| firefoxNode.service.type | string | `"ClusterIP"` | Service type |
451461
| firefoxNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
@@ -496,8 +506,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
496506
| edgeNode.resources.limits | object | `{"cpu":"1","memory":"2Gi"}` | Limit resources for edge-node pods |
497507
| edgeNode.securityContext | object | `{}` | SecurityContext for edge-node container |
498508
| edgeNode.hostAliases | string | `nil` | Custom host aliases for edge nodes |
499-
| edgeNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for edge nodes |
500-
| edgeNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for edge nodes |
509+
| edgeNode.extraEnvironmentVariables | list | `[]` | Custom environment variables for edge nodes |
510+
| edgeNode.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for edge nodes |
501511
| edgeNode.service.enabled | bool | `false` | Create a service for node |
502512
| edgeNode.service.type | string | `"ClusterIP"` | Service type |
503513
| edgeNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
@@ -548,8 +558,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
548558
| relayNode.tolerations | list | `[]` | Tolerations for relay-node pods |
549559
| relayNode.nodeSelector | object | `{}` | Node selector for relay-node pods |
550560
| relayNode.hostAliases | string | `nil` | Custom host aliases for relay nodes |
551-
| relayNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for relay nodes |
552-
| relayNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for relay nodes |
561+
| relayNode.extraEnvironmentVariables | list | `[]` | Custom environment variables for relay nodes |
562+
| relayNode.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for relay nodes |
553563
| relayNode.service.enabled | bool | `false` | Create a service for node |
554564
| relayNode.service.type | string | `"ClusterIP"` | Service type |
555565
| relayNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
@@ -594,15 +604,15 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
594604
| videoRecorder.resources.requests | object | `{"cpu":"1","memory":"1Gi"}` | Request resources for video recorder pods |
595605
| videoRecorder.resources.limits | object | `{"cpu":"1","memory":"1Gi"}` | Limit resources for video recorder pods |
596606
| videoRecorder.securityContext | string | `nil` | SecurityContext for recorder container |
597-
| videoRecorder.extraEnvironmentVariables | string | `nil` | Extra environment variables for video recorder |
598-
| videoRecorder.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for video recorder. |
607+
| videoRecorder.extraEnvironmentVariables | list | `[]` | Extra environment variables for video recorder |
608+
| videoRecorder.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for video recorder. |
599609
| videoRecorder.terminationGracePeriodSeconds | int | `30` | Terminating grace period for video recorder |
600610
| videoRecorder.startupProbe | object | `{}` | Startup probe settings |
601611
| videoRecorder.livenessProbe | object | `{}` | Liveness probe settings |
602612
| videoRecorder.lifecycle | object | `{}` | Define lifecycle events for video recorder |
603613
| videoRecorder.extraVolumeMounts | list | `[]` | Custom video recorder back-end scripts (video.sh, video_ready.py, etc.) further by ConfigMap. NOTE: For the mount point with the name "video", or "video-scripts", it will override the default. For other names, it will be appended. |
604614
| videoRecorder.extraVolumes | list | `[]` | Extra volumes for video recorder pod |
605-
| videoRecorder.s3 | object | `{"args":[],"command":[],"extraEnvironmentVariables":null,"imageName":"aws-cli","imagePullPolicy":"IfNotPresent","imageRegistry":"bitnami","imageTag":"latest","securityContext":{"runAsUser":0}}` | Container spec for the uploader if above it is defined as "uploader.name: s3" |
615+
| videoRecorder.s3 | object | `{"args":[],"command":[],"extraEnvironmentVariables":[],"imageName":"aws-cli","imagePullPolicy":"IfNotPresent","imageRegistry":"bitnami","imageTag":"latest","securityContext":{"runAsUser":0}}` | Container spec for the uploader if above it is defined as "uploader.name: s3" |
606616
| customLabels | object | `{}` | Custom labels for k8s resources |
607617
| keda.additionalAnnotations | string | `nil` | Annotations for KEDA resources |
608618
| keda.http.timeout | int | `60000` | |

Diff for: charts/selenium-grid/templates/distributor-deployment.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ spec:
7373
{{- with .Values.components.extraEnvironmentVariables }}
7474
{{- tpl (toYaml .) $ | nindent 12 }}
7575
{{- end }}
76+
{{- with .Values.components.distributor.extraEnvironmentVariables }}
77+
{{- tpl (toYaml .) $ | nindent 12 }}
78+
{{- end }}
7679
envFrom:
7780
- configMapRef:
7881
name: {{ template "seleniumGrid.distributor.configmap.fullname" . }}
@@ -88,9 +91,12 @@ spec:
8891
name: {{ template "seleniumGrid.common.secrets.fullname" $ }}
8992
- secretRef:
9093
name: {{ template "seleniumGrid.basicAuth.secrets.fullname" $ }}
91-
{{- with .Values.components.extraEnvFrom }}
92-
{{- toYaml . | nindent 12 }}
93-
{{- end }}
94+
{{- with .Values.components.extraEnvFrom }}
95+
{{- toYaml . | nindent 12 }}
96+
{{- end }}
97+
{{- with .Values.components.distributor.extraEnvFrom }}
98+
{{- toYaml . | nindent 12 }}
99+
{{- end }}
94100
volumeMounts:
95101
{{- range $fileName, $value := $.Values.distributorConfigMap.extraScripts }}
96102
- name: {{ tpl (default (include "seleniumGrid.distributor.configmap.fullname" $) $.Values.distributorConfigMap.scriptVolumeMountName) $ | quote }}

Diff for: charts/selenium-grid/templates/event-bus-deployment.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ spec:
5555
fieldPath: status.podIP
5656
- name: SE_EVENT_BUS_PORT
5757
value: {{ .Values.components.eventBus.port | quote }}
58-
{{- with .Values.components.extraEnvironmentVariables }}
58+
{{- with .Values.components.extraEnvironmentVariables }}
5959
{{- tpl (toYaml .) $ | nindent 12 }}
60-
{{- end }}
60+
{{- end }}
61+
{{- with .Values.components.eventBus.extraEnvironmentVariables }}
62+
{{- tpl (toYaml .) $ | nindent 12 }}
63+
{{- end }}
6164
envFrom:
6265
- configMapRef:
6366
name: {{ template "seleniumGrid.logging.configmap.fullname" $ }}
@@ -68,7 +71,10 @@ spec:
6871
- secretRef:
6972
name: {{ template "seleniumGrid.basicAuth.secrets.fullname" $ }}
7073
{{- with .Values.components.extraEnvFrom }}
71-
{{- toYaml . | nindent 12 }}
74+
{{- toYaml . | nindent 12 }}
75+
{{- end }}
76+
{{- with .Values.components.eventBus.extraEnvFrom }}
77+
{{- toYaml . | nindent 12 }}
7278
{{- end }}
7379
volumeMounts:
7480
{{- if eq (include "seleniumGrid.server.secureConnection" $) "true" }}

Diff for: charts/selenium-grid/templates/router-deployment.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ spec:
7272
{{- with .Values.components.extraEnvironmentVariables }}
7373
{{- tpl (toYaml .) $ | nindent 12 }}
7474
{{- end }}
75+
{{- with .Values.components.router.extraEnvironmentVariables }}
76+
{{- tpl (toYaml .) $ | nindent 12 }}
77+
{{- end }}
7578
envFrom:
7679
- configMapRef:
7780
name: {{ template "seleniumGrid.logging.configmap.fullname" $ }}
@@ -81,9 +84,12 @@ spec:
8184
name: {{ template "seleniumGrid.common.secrets.fullname" $ }}
8285
- secretRef:
8386
name: {{ template "seleniumGrid.basicAuth.secrets.fullname" $ }}
84-
{{- with .Values.components.extraEnvFrom }}
85-
{{- toYaml . | nindent 12 }}
86-
{{- end }}
87+
{{- with .Values.components.extraEnvFrom }}
88+
{{- toYaml . | nindent 12 }}
89+
{{- end }}
90+
{{- with .Values.components.router.extraEnvFrom }}
91+
{{- toYaml . | nindent 12 }}
92+
{{- end }}
8793
volumeMounts:
8894
{{- range $fileName, $value := $.Values.routerConfigMap.extraScripts }}
8995
- name: {{ tpl (default (include "seleniumGrid.router.configmap.fullname" $) $.Values.routerConfigMap.scriptVolumeMountName) $ | quote }}

0 commit comments

Comments
 (0)