Skip to content

Commit fc21bef

Browse files
authored
feat: Add option to inject sidecars into Node Pods (#1938)
* Add option to inject sidecars into Node Pods * Add example to add sidecar
1 parent 627f50d commit fc21bef

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

charts/selenium-grid/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ Once you have a new chart version, you can update your selenium-grid running:
6161
helm upgrade selenium-grid docker-selenium/selenium-grid
6262
```
6363

64+
If needed, you can add sidecars for your browser nodes by running:
65+
66+
```bash
67+
helm upgrade selenium-grid docker-selenium/selenium-grid --set 'firefoxNode.enabled=true' --set-json 'firefoxNode.sidecars=[{"name":"my-sidecar","image":"my-sidecar:latest","imagePullPolicy":"IfNotPresent","ports":[{"containerPort":8080, "protocol":"TCP"}],"resources":{"limits":{"memory": "128Mi"},"requests":{"cpu": "100m"}}}]'
68+
```
69+
70+
Note: the parameter used for --set-json is just an example, please refer to [Container Spec](https://www.devspace.sh/component-chart/docs/configuration/containers) for an overview of usable parameters.
71+
6472
## Uninstalling Selenium Grid release
6573

6674
To uninstall:

charts/selenium-grid/templates/_helpers.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ template:
165165
{{- with .node.livenessProbe }}
166166
livenessProbe: {{- toYaml . | nindent 10 }}
167167
{{- end }}
168+
{{- if .node.sidecars }}
169+
{{- toYaml .node.sidecars | nindent 6 }}
170+
{{- end }}
168171
{{- if or .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }}
169172
imagePullSecrets:
170173
- name: {{ default .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }}

charts/selenium-grid/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ chromeNode:
479479
# browserVersion: '91.0' # Optional. Only required when supporting multiple versions of browser in your Selenium Grid.
480480
unsafeSsl : 'true' # Optional
481481

482+
# It is used to add a sidecars proxy in the same pod of the browser node.
483+
# It means it will add a new container to the deployment itself.
484+
# It should be set using the --set-json option
485+
sidecars: []
486+
487+
482488
# Configuration for firefox nodes
483489
firefoxNode:
484490
# Enable firefox nodes
@@ -593,6 +599,11 @@ firefoxNode:
593599
url: '{{ include "seleniumGrid.graphqlURL" . }}'
594600
browserName: firefox
595601

602+
# It is used to add a sidecars proxy in the same pod of the browser node.
603+
# It means it will add a new container to the deployment itself.
604+
# It should be set using the --set-json option
605+
sidecars: []
606+
596607
# Configuration for edge nodes
597608
edgeNode:
598609
# Enable edge nodes
@@ -708,5 +719,10 @@ edgeNode:
708719
browserName: MicrosoftEdge
709720
sessionBrowserName: 'msedge'
710721

722+
# It is used to add a sidecars proxy in the same pod of the browser node.
723+
# It means it will add a new container to the deployment itself.
724+
# It should be set using the --set-json option
725+
sidecars: []
726+
711727
# Custom labels for k8s resources
712728
customLabels: {}

0 commit comments

Comments
 (0)