3

I want to install Selenium Grid 4 in Kubernetes. I am new to this. Could anyone share helm charts or manifests or installation steps or anything. I could not find anything.

Thanks.

Aman
  • 193
  • 2
  • 15
  • Hi @WytrzymałyWiktor Not really. I was looking forward to complete manifests. I can not call the below manifests as production grade. – Aman Jul 07 '21 at 14:24

3 Answers3

3

You can find the selenium docker hub image at : https://hub.docker.com/layers/selenium/hub/4.0.0-alpha-6-20200730

YAML example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: selenium-hub
spec:
  selector:
    matchLabels:
      app: selenium-hub
  strategy:
    type: RollingUpdate
    rollingUpdate:
     maxSurge: 1
     maxUnavailable: 0
  template:
    metadata:
      labels:
        app: selenium-hub
    spec:
      containers:
      - name: selenium-hub
        image: selenium/hub:3.141.59-20200515
        resources:
          limits:
            memory: "1000Mi"
            cpu: "500m"
        ports:
          - containerPort: 4444
        livenessProbe:
            httpGet:
              path: /wd/hub/status
              port: 4444
            initialDelaySeconds: 30
            timeoutSeconds: 5

you can read more at : https://www.swtestacademy.com/selenium-kubernetes-scalable-parallel-tests/

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
2

It might be late for answer but now we have selemium-hub with helm charts. Just posting the link in case someone stumbles upon the same issue. Thank you for the contributions.

Selenium-hub helm chart

Aman
  • 193
  • 2
  • 15
1

I have found a tutorial to for set up Selenium grid in Kubernetes cluster. And here you can find examples:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: selenium-hub
spec:
  selector:
    matchLabels:
      app: selenium-hub
  strategy: 
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0      
  template:
    metadata:
      labels:
        app: selenium-hub
    spec:
      containers:
      - name: selenium-hub
        image: selenium/hub:4.0.0
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
          - containerPort: 4444
        livenessProbe:
            httpGet:
              path: /wd/hub/status
              port: 4444
            initialDelaySeconds: 30
            timeoutSeconds: 5
apiVersion: v1
kind: Pod
metadata:
  name: selenium-hub
  labels:
    name: hub
spec:
  containers:
  - name: selenium-hub
    image: selenium/hub:3.141.59-20200326
    resources:
      limits:
        memory: "128Mi"
        cpu: "500m"
    ports:
      - containerPort: 4444
    livenessProbe:
        httpGet:
          path: /wd/hub/status
          port: 4444
        initialDelaySeconds: 30
        timeoutSeconds: 5
apiVersion: v1
kind: ReplicationController
metadata:
  name: selenium-rep
spec:
  replicas: 2
  selector:
    app: selenium-chrome
  template:
    metadata:
      name: selenium-chrome
      labels:
        app: selenium-chrome
    spec:
      containers:
        - name: node-chrome
          image: selenium/node-chrome
          ports:
            - containerPort: 5555
          env:
            - name: HUB_HOST
              value: "selenium-srv"
            - name: HUB_PORT
              value: "4444"
apiVersion: v1
kind: Service
metadata:
  name: selenium-srv
  labels:
    app: selenium-srv
spec:
  selector:
    app: selenium-hub
  ports:
  - port: 4444
    nodePort: 30001
  type: NodePort

This tutorial is also recorded on YouTube. You can find there a playlist with a couple of episodes related to Selenium Grid on Kubernetes.

Mikołaj Głodziak
  • 4,775
  • 7
  • 28