Skip to content

Commit db98b37

Browse files
author
Zadjad Rezai
authored
Add ability to insert entire configmap/secret into env. (#1521)
1 parent e8b6986 commit db98b37

11 files changed

+67
-1
lines changed

chart/selenium-grid/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ This table contains the configuration parameters of the chart and their default
6363
| `chromeNode.tolerations` | `[]` | Tolerations for chrome-node container |
6464
| `chromeNode.nodeSelector` | `{}` | Node Selector for chrome-node container |
6565
| `chromeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for chrome nodes |
66+
| `chromeNode.extraEnvFrom` | `nil` | Custom environment taken from `configMap` or `secret` variables for chrome nodes |
6667
| `chromeNode.service.enabled` | `true` | Create a service for node |
6768
| `chromeNode.service.type` | `ClusterIP` | Service type |
6869
| `chromeNode.service.annotations` | `{}` | Custom annotations for service |
@@ -81,6 +82,7 @@ This table contains the configuration parameters of the chart and their default
8182
| `firefoxNode.tolerations` | `[]` | Tolerations for firefox-node container |
8283
| `firefoxNode.nodeSelector` | `{}` | Node Selector for firefox-node container |
8384
| `firefoxNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
85+
| `firefoxNode.extraEnvFrom` | `nil` | Custom environment variables taken from `configMap` or `secret` for firefox nodes |
8486
| `firefoxNode.service.enabled` | `true` | Create a service for node |
8587
| `firefoxNode.service.type` | `ClusterIP` | Service type |
8688
| `firefoxNode.service.annotations` | `{}` | Custom annotations for service |
@@ -99,6 +101,7 @@ This table contains the configuration parameters of the chart and their default
99101
| `edgeNode.tolerations` | `[]` | Tolerations for edge-node container |
100102
| `edgeNode.nodeSelector` | `{}` | Node Selector for edge-node container |
101103
| `edgeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
104+
| `edgeNode.extraEnvFrom` | `nil` | Custom environment taken from `configMap` or `secret` variables for firefox nodes |
102105
| `edgeNode.service.enabled` | `true` | Create a service for node |
103106
| `edgeNode.service.type` | `ClusterIP` | Service type |
104107
| `edgeNode.service.annotations` | `{}` | Custom annotations for service |
@@ -125,6 +128,7 @@ You can configure the Selenium Hub with this values:
125128
| `hub.tolerations` | `[]` | Tolerations for selenium-hub container |
126129
| `hub.nodeSelector` | `{}` | Node Selector for selenium-hub container |
127130
| `hub.extraEnvironmentVariables` | `nil` | Custom environment variables for selenium-hub |
131+
| `hub.extraEnvFrom` | `nil` | Custom environment variables for selenium taken from `configMap` or `secret`-hub |
128132
| `hub.resources` | `{}` | Resources for selenium-hub container |
129133
| `hub.serviceType` | `NodePort` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) |
130134
| `hub.serviceAnnotations` | `{}` | Custom annotations for Selenium Hub service |
@@ -179,5 +183,6 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
179183
| `components.sessionQueue.serviceType` | `ClusterIP` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) |
180184
| `components.sessionQueue.serviceAnnotations` | `{}` | Custom annotations for Session Queue service |
181185
| `components.extraEnvironmentVariables` | `nil` | Custom environment variables for all components |
186+
| `components.extraEnvFrom` | `nil` | Custom environment variables taken from `configMap` or `secret` for all components |
182187

183188
See how to customize a helm chart installation in the [Helm Docs](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing) for more information.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ spec:
3939
envFrom:
4040
- configMapRef:
4141
name: {{ .Values.busConfigMap.name }}
42+
{{- with .Values.chromeNode.extraEnvFrom }}
43+
{{- toYaml . | nindent 12 }}
44+
{{- end }}
4245
{{- if gt (len .Values.chromeNode.ports) 0 }}
4346
ports:
4447
{{- range .Values.chromeNode.ports }}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ spec:
4343
envFrom:
4444
- configMapRef:
4545
name: {{ .Values.busConfigMap.name }}
46+
{{- with .Values.components.extraEnvFrom }}
47+
{{- toYaml . | nindent 12 }}
48+
{{- end }}
4649
ports:
4750
- containerPort: {{ .Values.components.distributor.port }}
4851
protocol: TCP

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ spec:
3939
envFrom:
4040
- configMapRef:
4141
name: {{ .Values.busConfigMap.name }}
42+
{{- with .Values.edgeNode.extraEnvFrom }}
43+
{{- toYaml . | nindent 12 }}
44+
{{- end }}
4245
{{- if gt (len .Values.edgeNode.ports) 0 }}
4346
ports:
4447
{{- range .Values.edgeNode.ports }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
{{- with .Values.components.extraEnvironmentVariables }}
3939
env: {{- tpl (toYaml .) $ | nindent 12 }}
4040
{{- end }}
41+
envFrom:
42+
{{- with .Values.components.extraEnvFrom }}
43+
{{- toYaml . | nindent 12 }}
44+
{{- end }}
4145
{{- with .Values.components.eventBus.resources }}
4246
resources: {{- toYaml . | nindent 12 }}
4347
{{- end }}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ spec:
3939
envFrom:
4040
- configMapRef:
4141
name: {{ .Values.busConfigMap.name }}
42+
{{- with .Values.firefoxNode.extraEnvFrom }}
43+
{{- toYaml . | nindent 12 }}
44+
{{- end }}
4245
{{- if gt (len .Values.firefoxNode.ports) 0 }}
4346
ports:
4447
{{- range .Values.firefoxNode.ports }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ spec:
6363
{{- with .Values.hub.extraEnvironmentVariables }}
6464
env: {{- tpl (toYaml .) $ | nindent 12 }}
6565
{{- end }}
66+
envFrom:
67+
{{- with .Values.hub.extraEnvFrom }}
68+
{{- toYaml . | nindent 12 }}
69+
{{- end }}
6670
{{- with .Values.hub.resources }}
6771
resources: {{- toYaml . | nindent 12 }}
6872
{{- end }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ spec:
4444
{{- with .Values.components.extraEnvironmentVariables }}
4545
{{- tpl (toYaml .) $ | nindent 12 }}
4646
{{- end }}
47+
envFrom:
48+
{{- with .Values.components.extraEnvFrom }}
49+
{{- toYaml . | nindent 12 }}
50+
{{- end }}
4751
ports:
4852
- containerPort: {{ .Values.components.router.port }}
4953
protocol: TCP

chart/selenium-grid/templates/session-map-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ spec:
3434
envFrom:
3535
- configMapRef:
3636
name: {{ .Values.busConfigMap.name }}
37+
{{- with .Values.components.extraEnvFrom }}
38+
{{- toYaml . | nindent 12 }}
39+
{{- end }}
3740
ports:
3841
- containerPort: {{ .Values.components.sessionMap.port }}
3942
protocol: TCP

chart/selenium-grid/templates/session-queuer-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ spec:
3434
envFrom:
3535
- configMapRef:
3636
name: {{ .Values.busConfigMap.name }}
37+
{{- with .Values.components.extraEnvFrom }}
38+
{{- toYaml . | nindent 12 }}
39+
{{- end }}
3740
ports:
3841
- containerPort: {{ .Values.components.sessionQueue.port }}
3942
protocol: TCP

chart/selenium-grid/values.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ components:
168168
# name: secret-name
169169
# key: secret-key
170170

171+
# Custom environment variables by sourcing entire configMap, Secret, etc. for all components
172+
extraEnvFrom:
173+
# - configMapRef:
174+
# name: proxy-settings
175+
# - secretRef:
176+
# name: mysecret
177+
171178
# Configuration for selenium hub deployment (applied only if `isolateComponents: false`)
172179
hub:
173180
# Selenium Hub image name
@@ -213,6 +220,12 @@ hub:
213220
# secretKeyRef:
214221
# name: secret-name
215222
# key: secret-key
223+
# Custom environment variables by sourcing entire configMap, Secret, etc. for selenium-hub
224+
extraEnvFrom:
225+
# - configMapRef:
226+
# name: proxy-settings
227+
# - secretRef:
228+
# name: mysecret
216229
# Resources for selenium-hub container
217230
resources: {}
218231
# Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
@@ -268,6 +281,12 @@ chromeNode:
268281
# secretKeyRef:
269282
# name: secret-name
270283
# key: secret-key
284+
# Custom environment variables by sourcing entire configMap, Secret, etc. for chrome nodes
285+
extraEnvFrom:
286+
# - configMapRef:
287+
# name: proxy-settings
288+
# - secretRef:
289+
# name: mysecret
271290
# Service configuration
272291
service:
273292
# Create a service for node
@@ -323,6 +342,12 @@ firefoxNode:
323342
# secretKeyRef:
324343
# name: secret-name
325344
# key: secret-key
345+
# Custom environment variables by sourcing entire configMap, Secret, etc. for firefox nodes
346+
extraEnvFrom:
347+
# - configMapRef:
348+
# name: proxy-settings
349+
# - secretRef:
350+
# name: mysecret
326351
# Service configuration
327352
service:
328353
# Create a service for node
@@ -368,7 +393,7 @@ edgeNode:
368393
limits:
369394
memory: "1Gi"
370395
cpu: "1"
371-
# Custom environment variables for firefox nodes
396+
# Custom environment variables for edge nodes
372397
extraEnvironmentVariables:
373398
# - name: JAVA_OPTS
374399
# value: "-Xmx512m"
@@ -377,6 +402,12 @@ edgeNode:
377402
# secretKeyRef:
378403
# name: secret-name
379404
# key: secret-key
405+
# Custom environment variables by sourcing entire configMap, Secret, etc. for edge nodes
406+
extraEnvFrom:
407+
# - configMapRef:
408+
# name: proxy-settings
409+
# - secretRef:
410+
# name: mysecret
380411
# Service configuration
381412
service:
382413
# Create a service for node

0 commit comments

Comments
 (0)