Skip to content

Commit f0ab6c9

Browse files
committed
K8s: Add reference YAML to get started with simple things
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent da16f65 commit f0ab6c9

10 files changed

+436
-2
lines changed

Diff for: README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,10 @@ ___
10011001

10021002
## Deploying to Kubernetes
10031003

1004-
We offer a Helm chart to deploy these Docker images to Kubernetes.
1005-
Read more details at the Helm [readme](./charts/selenium-grid/README.md).
1004+
Get started to deploy Selenium Grid on Kubernetes, you can refer to YAML files in the [kubernetes](./kubernetes) directory.
1005+
1006+
To simplify the deployment process, hide the complexity of Kubernetes objects, and provide a more straightforward way to deploy Selenium Grid on Kubernetes, we offer a Helm chart to deploy Selenium Grid to Kubernetes.
1007+
Read more details at the Helm [chart README](./charts/selenium-grid/README.md) and [chart CONFIGURATION](./charts/selenium-grid/CONFIGURATION.md).
10061008

10071009
___
10081010

Diff for: kubernetes/Hub_Node/hub-deployment.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-hub
5+
labels:
6+
app: selenium-hub
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: selenium-hub
12+
template:
13+
metadata:
14+
labels:
15+
app: selenium-hub
16+
spec:
17+
containers:
18+
- name: selenium-hub
19+
image: selenium/hub:4.29.0-20250303
20+
ports:
21+
- containerPort: 4444
22+
- containerPort: 4443
23+
- containerPort: 4442
24+
env:
25+
- name: SE_SESSION_REQUEST_TIMEOUT
26+
value: "600"
27+
- name: SE_ROUTER_USERNAME
28+
value: "admin"
29+
- name: SE_ROUTER_PASSWORD
30+
value: "admin"
31+
- name: SE_REGISTRATION_SECRET
32+
value: "secret"
33+
resources:
34+
requests:
35+
memory: "512Mi"
36+
cpu: "0.5"
37+
limits:
38+
memory: "2048Mi"
39+
cpu: "1"
40+
livenessProbe:
41+
exec:
42+
command:
43+
- /bin/sh
44+
- -c
45+
- curl -G --fail --silent -u ${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD} localhost:4444/status
46+
initialDelaySeconds: 30
47+
timeoutSeconds: 5
48+
readinessProbe:
49+
httpGet:
50+
path: /readyz
51+
port: 4444
52+
initialDelaySeconds: 30
53+
timeoutSeconds: 5

Diff for: kubernetes/Hub_Node/hub-svc.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: selenium-hub
5+
spec:
6+
selector:
7+
app: selenium-hub
8+
ports:
9+
- name: bus-publish
10+
port: 4442
11+
targetPort: 4442
12+
- name: bus-subscribe
13+
port: 4443
14+
targetPort: 4443
15+
- name: web
16+
port: 4444
17+
targetPort: 4444
18+
nodePort: 30444
19+
type: NodePort

Diff for: kubernetes/Hub_Node/node-chrome-deployment.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-node-chrome
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: selenium-node-chrome
10+
template:
11+
metadata:
12+
labels:
13+
app: selenium-node-chrome
14+
spec:
15+
containers:
16+
- name: chrome
17+
image: selenium/node-chrome:4.29.0-20250303
18+
env:
19+
- name: SE_EVENT_BUS_HOST
20+
value: "selenium-hub"
21+
- name: SE_NODE_SESSION_TIMEOUT
22+
value: "600"
23+
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
24+
value: "true"
25+
- name: SE_REGISTRATION_SECRET
26+
value: "secret"
27+
resources:
28+
requests:
29+
memory: "1Gi"
30+
cpu: "0.5"
31+
limits:
32+
memory: "2Gi"
33+
cpu: "2"
34+
volumeMounts:
35+
- mountPath: /dev/shm
36+
name: dshm
37+
volumes:
38+
- name: dshm
39+
emptyDir:
40+
medium: Memory
41+
sizeLimit: 2Gi

Diff for: kubernetes/Hub_Node/node-edge-deployment.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-node-edge
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: selenium-node-edge
10+
template:
11+
metadata:
12+
labels:
13+
app: selenium-node-edge
14+
spec:
15+
containers:
16+
- name: chrome
17+
image: selenium/node-edge:4.29.0-20250303
18+
env:
19+
- name: SE_EVENT_BUS_HOST
20+
value: "selenium-hub"
21+
- name: SE_NODE_SESSION_TIMEOUT
22+
value: "600"
23+
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
24+
value: "true"
25+
- name: SE_REGISTRATION_SECRET
26+
value: "secret"
27+
resources:
28+
requests:
29+
memory: "1Gi"
30+
cpu: "0.5"
31+
limits:
32+
memory: "2Gi"
33+
cpu: "2"
34+
volumeMounts:
35+
- mountPath: /dev/shm
36+
name: dshm
37+
volumes:
38+
- name: dshm
39+
emptyDir:
40+
medium: Memory
41+
sizeLimit: 2Gi

Diff for: kubernetes/Hub_Node/node-firefox-deployment.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-node-firefox
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: selenium-node-firefox
10+
template:
11+
metadata:
12+
labels:
13+
app: selenium-node-firefox
14+
spec:
15+
containers:
16+
- name: chrome
17+
image: selenium/node-firefox:4.29.0-20250303
18+
env:
19+
- name: SE_EVENT_BUS_HOST
20+
value: "selenium-hub"
21+
- name: SE_NODE_SESSION_TIMEOUT
22+
value: "600"
23+
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
24+
value: "true"
25+
- name: SE_REGISTRATION_SECRET
26+
value: "secret"
27+
resources:
28+
requests:
29+
memory: "1Gi"
30+
cpu: "0.5"
31+
limits:
32+
memory: "2Gi"
33+
cpu: "2"
34+
volumeMounts:
35+
- mountPath: /dev/shm
36+
name: dshm
37+
volumes:
38+
- name: dshm
39+
emptyDir:
40+
medium: Memory
41+
sizeLimit: 2Gi

Diff for: kubernetes/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Introduction
2+
3+
Without using Helm chart, this is reference YAML manifest to get started deploying Selenium Grid on Kubernetes.

Diff for: kubernetes/Standalone/standalone-chrome.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-standalone-chrome
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: selenium-standalone-chrome
10+
template:
11+
metadata:
12+
labels:
13+
app: selenium-standalone-chrome
14+
spec:
15+
containers:
16+
- name: chrome
17+
image: selenium/standalone-chrome:4.29.0-20250303
18+
ports:
19+
- containerPort: 4444
20+
- containerPort: 7900
21+
env:
22+
- name: SE_SESSION_REQUEST_TIMEOUT
23+
value: "600"
24+
- name: SE_ROUTER_USERNAME
25+
value: "admin"
26+
- name: SE_ROUTER_PASSWORD
27+
value: "admin"
28+
- name: SE_NODE_SESSION_TIMEOUT
29+
value: "600"
30+
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
31+
value: "true"
32+
resources:
33+
requests:
34+
memory: "1Gi"
35+
cpu: "0.5"
36+
limits:
37+
memory: "4Gi"
38+
cpu: "2"
39+
livenessProbe:
40+
exec:
41+
command:
42+
- /bin/sh
43+
- -c
44+
- curl -G --fail --silent -u ${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD} localhost:4444/status
45+
initialDelaySeconds: 30
46+
timeoutSeconds: 5
47+
readinessProbe:
48+
httpGet:
49+
path: /readyz
50+
port: 4444
51+
initialDelaySeconds: 30
52+
timeoutSeconds: 5
53+
volumeMounts:
54+
- mountPath: /dev/shm
55+
name: dshm
56+
volumes:
57+
- name: dshm
58+
emptyDir:
59+
medium: Memory
60+
sizeLimit: 2Gi
61+
---
62+
apiVersion: v1
63+
kind: Service
64+
metadata:
65+
name: selenium-standalone-chrome
66+
spec:
67+
selector:
68+
app: selenium-standalone-chrome
69+
ports:
70+
- name: web
71+
port: 4444
72+
targetPort: 4444
73+
nodePort: 30444
74+
- name: vnc
75+
port: 7900
76+
targetPort: 7900
77+
nodePort: 30790
78+
type: NodePort

Diff for: kubernetes/Standalone/standalone-edge.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: selenium-standalone-edge
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: selenium-standalone-edge
10+
template:
11+
metadata:
12+
labels:
13+
app: selenium-standalone-edge
14+
spec:
15+
containers:
16+
- name: chrome
17+
image: selenium/standalone-edge:4.29.0-20250303
18+
ports:
19+
- containerPort: 4444
20+
- containerPort: 7900
21+
env:
22+
- name: SE_SESSION_REQUEST_TIMEOUT
23+
value: "600"
24+
- name: SE_ROUTER_USERNAME
25+
value: "admin"
26+
- name: SE_ROUTER_PASSWORD
27+
value: "admin"
28+
- name: SE_NODE_SESSION_TIMEOUT
29+
value: "600"
30+
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
31+
value: "true"
32+
resources:
33+
requests:
34+
memory: "1Gi"
35+
cpu: "0.5"
36+
limits:
37+
memory: "4Gi"
38+
cpu: "2"
39+
livenessProbe:
40+
exec:
41+
command:
42+
- /bin/sh
43+
- -c
44+
- curl -G --fail --silent -u ${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD} localhost:4444/status
45+
initialDelaySeconds: 30
46+
timeoutSeconds: 5
47+
readinessProbe:
48+
httpGet:
49+
path: /readyz
50+
port: 4444
51+
initialDelaySeconds: 30
52+
timeoutSeconds: 5
53+
volumeMounts:
54+
- mountPath: /dev/shm
55+
name: dshm
56+
volumes:
57+
- name: dshm
58+
emptyDir:
59+
medium: Memory
60+
sizeLimit: 2Gi
61+
---
62+
apiVersion: v1
63+
kind: Service
64+
metadata:
65+
name: selenium-standalone-edge
66+
spec:
67+
selector:
68+
app: selenium-standalone-edge
69+
ports:
70+
- name: web
71+
port: 4444
72+
targetPort: 4444
73+
nodePort: 30445
74+
- name: vnc
75+
port: 7900
76+
targetPort: 7900
77+
nodePort: 30791
78+
type: NodePort

0 commit comments

Comments
 (0)