Skip to content

Commit 4b9fc60

Browse files
authored
K8s: Add option to inject network policies into chart (#3033)
1 parent 4d6f29e commit 4b9fc60

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

charts/selenium-grid/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,14 @@ helm upgrade selenium-grid docker-selenium/selenium-grid --set 'firefoxNode.enab
409409

410410
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.
411411

412+
If needed, you can add network policies for your selenium-grid by running:
413+
414+
```bash
415+
helm upgrade selenium-grid docker-selenium/selenium-grid --set 'firefoxNode.enabled=true' --set-json 'networkPolicies={"allow-selenium":{"podSelector":{"matchLabels":{"app.kubernetes.io/name":"selenium-node-firefox"}},"policyTypes":["Egress"],"egress":[{}]}}'
416+
```
417+
418+
Note: the parameter used for --set-json is just an example, please refer to [Network Policy Spec](https://kubernetes.io/docs/concepts/services-networking/network-policies/) for an overview of usable parameters.
419+
412420
## Uninstalling Selenium Grid release
413421

414422
To uninstall:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- range $name, $spec := .Values.networkPolicies }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: {{ $name }}
6+
namespace: {{ $.Release.Namespace }}
7+
spec:
8+
{{ toYaml $spec | indent 2 }}
9+
---
10+
{{- end }}

charts/selenium-grid/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,6 +2185,18 @@ videoManager:
21852185
# persistentVolumeClaim:
21862186
# claimName: video-pv-claim
21872187

2188+
# -- Add network policies to this chart
2189+
# It can be set using the --set-json option
2190+
networkPolicies: {}
2191+
# allow-selenium:
2192+
# podSelector:
2193+
# matchLabels:
2194+
# app.kubernetes.io/name: selenium-node-firefox
2195+
# policyTypes:
2196+
# - Egress
2197+
# egress:
2198+
# - {}
2199+
21882200
# Configuration for dependency chart keda
21892201
keda:
21902202
# enabled: false

0 commit comments

Comments
 (0)