Skip to content

Commit

Permalink
feat: Add option to inject sidecars into Node Pods (#1938)
Browse files Browse the repository at this point in the history
* Add option to inject sidecars into Node Pods

* Add example to add sidecar
  • Loading branch information
marcusalb authored Sep 11, 2023
1 parent 627f50d commit fc21bef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/selenium-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ Once you have a new chart version, you can update your selenium-grid running:
helm upgrade selenium-grid docker-selenium/selenium-grid
```

If needed, you can add sidecars for your browser nodes by running:

```bash
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"}}}]'
```

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.

## Uninstalling Selenium Grid release

To uninstall:
Expand Down
3 changes: 3 additions & 0 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ template:
{{- with .node.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 10 }}
{{- end }}
{{- if .node.sidecars }}
{{- toYaml .node.sidecars | nindent 6 }}
{{- end }}
{{- if or .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }}
imagePullSecrets:
- name: {{ default .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }}
Expand Down
16 changes: 16 additions & 0 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,12 @@ chromeNode:
# browserVersion: '91.0' # Optional. Only required when supporting multiple versions of browser in your Selenium Grid.
unsafeSsl : 'true' # Optional

# It is used to add a sidecars proxy in the same pod of the browser node.
# It means it will add a new container to the deployment itself.
# It should be set using the --set-json option
sidecars: []


# Configuration for firefox nodes
firefoxNode:
# Enable firefox nodes
Expand Down Expand Up @@ -593,6 +599,11 @@ firefoxNode:
url: '{{ include "seleniumGrid.graphqlURL" . }}'
browserName: firefox

# It is used to add a sidecars proxy in the same pod of the browser node.
# It means it will add a new container to the deployment itself.
# It should be set using the --set-json option
sidecars: []

# Configuration for edge nodes
edgeNode:
# Enable edge nodes
Expand Down Expand Up @@ -708,5 +719,10 @@ edgeNode:
browserName: MicrosoftEdge
sessionBrowserName: 'msedge'

# It is used to add a sidecars proxy in the same pod of the browser node.
# It means it will add a new container to the deployment itself.
# It should be set using the --set-json option
sidecars: []

# Custom labels for k8s resources
customLabels: {}

0 comments on commit fc21bef

Please sign in to comment.