Skip to content

Commit

Permalink
Add ability to insert entire configmap/secret into env. (#1521)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zadjad Rezai authored Mar 14, 2022
1 parent e8b6986 commit db98b37
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 1 deletion.
5 changes: 5 additions & 0 deletions chart/selenium-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ This table contains the configuration parameters of the chart and their default
| `chromeNode.tolerations` | `[]` | Tolerations for chrome-node container |
| `chromeNode.nodeSelector` | `{}` | Node Selector for chrome-node container |
| `chromeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for chrome nodes |
| `chromeNode.extraEnvFrom` | `nil` | Custom environment taken from `configMap` or `secret` variables for chrome nodes |
| `chromeNode.service.enabled` | `true` | Create a service for node |
| `chromeNode.service.type` | `ClusterIP` | Service type |
| `chromeNode.service.annotations` | `{}` | Custom annotations for service |
Expand All @@ -81,6 +82,7 @@ This table contains the configuration parameters of the chart and their default
| `firefoxNode.tolerations` | `[]` | Tolerations for firefox-node container |
| `firefoxNode.nodeSelector` | `{}` | Node Selector for firefox-node container |
| `firefoxNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
| `firefoxNode.extraEnvFrom` | `nil` | Custom environment variables taken from `configMap` or `secret` for firefox nodes |
| `firefoxNode.service.enabled` | `true` | Create a service for node |
| `firefoxNode.service.type` | `ClusterIP` | Service type |
| `firefoxNode.service.annotations` | `{}` | Custom annotations for service |
Expand All @@ -99,6 +101,7 @@ This table contains the configuration parameters of the chart and their default
| `edgeNode.tolerations` | `[]` | Tolerations for edge-node container |
| `edgeNode.nodeSelector` | `{}` | Node Selector for edge-node container |
| `edgeNode.extraEnvironmentVariables` | `nil` | Custom environment variables for firefox nodes |
| `edgeNode.extraEnvFrom` | `nil` | Custom environment taken from `configMap` or `secret` variables for firefox nodes |
| `edgeNode.service.enabled` | `true` | Create a service for node |
| `edgeNode.service.type` | `ClusterIP` | Service type |
| `edgeNode.service.annotations` | `{}` | Custom annotations for service |
Expand All @@ -125,6 +128,7 @@ You can configure the Selenium Hub with this values:
| `hub.tolerations` | `[]` | Tolerations for selenium-hub container |
| `hub.nodeSelector` | `{}` | Node Selector for selenium-hub container |
| `hub.extraEnvironmentVariables` | `nil` | Custom environment variables for selenium-hub |
| `hub.extraEnvFrom` | `nil` | Custom environment variables for selenium taken from `configMap` or `secret`-hub |
| `hub.resources` | `{}` | Resources for selenium-hub container |
| `hub.serviceType` | `NodePort` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) |
| `hub.serviceAnnotations` | `{}` | Custom annotations for Selenium Hub service |
Expand Down Expand Up @@ -179,5 +183,6 @@ If you implement selenium-grid with separate components (`isolateComponents: tru
| `components.sessionQueue.serviceType` | `ClusterIP` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) |
| `components.sessionQueue.serviceAnnotations` | `{}` | Custom annotations for Session Queue service |
| `components.extraEnvironmentVariables` | `nil` | Custom environment variables for all components |
| `components.extraEnvFrom` | `nil` | Custom environment variables taken from `configMap` or `secret` for all components |

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.
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/chrome-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.chromeNode.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if gt (len .Values.chromeNode.ports) 0 }}
ports:
{{- range .Values.chromeNode.ports }}
Expand Down
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.components.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.components.distributor.port }}
protocol: TCP
Expand Down
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/edge-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.edgeNode.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if gt (len .Values.edgeNode.ports) 0 }}
ports:
{{- range .Values.edgeNode.ports }}
Expand Down
4 changes: 4 additions & 0 deletions chart/selenium-grid/templates/event-bus-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ spec:
{{- with .Values.components.extraEnvironmentVariables }}
env: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
envFrom:
{{- with .Values.components.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.components.eventBus.resources }}
resources: {{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/firefox-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.firefoxNode.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if gt (len .Values.firefoxNode.ports) 0 }}
ports:
{{- range .Values.firefoxNode.ports }}
Expand Down
4 changes: 4 additions & 0 deletions chart/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
{{- with .Values.hub.extraEnvironmentVariables }}
env: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
envFrom:
{{- with .Values.hub.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.hub.resources }}
resources: {{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions chart/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ spec:
{{- with .Values.components.extraEnvironmentVariables }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
envFrom:
{{- with .Values.components.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.components.router.port }}
protocol: TCP
Expand Down
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/session-map-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.components.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.components.sessionMap.port }}
protocol: TCP
Expand Down
3 changes: 3 additions & 0 deletions chart/selenium-grid/templates/session-queuer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
{{- with .Values.components.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.components.sessionQueue.port }}
protocol: TCP
Expand Down
33 changes: 32 additions & 1 deletion chart/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ components:
# name: secret-name
# key: secret-key

# Custom environment variables by sourcing entire configMap, Secret, etc. for all components
extraEnvFrom:
# - configMapRef:
# name: proxy-settings
# - secretRef:
# name: mysecret

# Configuration for selenium hub deployment (applied only if `isolateComponents: false`)
hub:
# Selenium Hub image name
Expand Down Expand Up @@ -213,6 +220,12 @@ hub:
# secretKeyRef:
# name: secret-name
# key: secret-key
# Custom environment variables by sourcing entire configMap, Secret, etc. for selenium-hub
extraEnvFrom:
# - configMapRef:
# name: proxy-settings
# - secretRef:
# name: mysecret
# Resources for selenium-hub container
resources: {}
# Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
Expand Down Expand Up @@ -268,6 +281,12 @@ chromeNode:
# secretKeyRef:
# name: secret-name
# key: secret-key
# Custom environment variables by sourcing entire configMap, Secret, etc. for chrome nodes
extraEnvFrom:
# - configMapRef:
# name: proxy-settings
# - secretRef:
# name: mysecret
# Service configuration
service:
# Create a service for node
Expand Down Expand Up @@ -323,6 +342,12 @@ firefoxNode:
# secretKeyRef:
# name: secret-name
# key: secret-key
# Custom environment variables by sourcing entire configMap, Secret, etc. for firefox nodes
extraEnvFrom:
# - configMapRef:
# name: proxy-settings
# - secretRef:
# name: mysecret
# Service configuration
service:
# Create a service for node
Expand Down Expand Up @@ -368,7 +393,7 @@ edgeNode:
limits:
memory: "1Gi"
cpu: "1"
# Custom environment variables for firefox nodes
# Custom environment variables for edge nodes
extraEnvironmentVariables:
# - name: JAVA_OPTS
# value: "-Xmx512m"
Expand All @@ -377,6 +402,12 @@ edgeNode:
# secretKeyRef:
# name: secret-name
# key: secret-key
# Custom environment variables by sourcing entire configMap, Secret, etc. for edge nodes
extraEnvFrom:
# - configMapRef:
# name: proxy-settings
# - secretRef:
# name: mysecret
# Service configuration
service:
# Create a service for node
Expand Down

0 comments on commit db98b37

Please sign in to comment.