How to install Selenium Grid 4 in Kubernetes? How to install Selenium Grid 4 in Kubernetes? kubernetes kubernetes

How to install Selenium Grid 4 in Kubernetes?


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/v1kind: Deploymentmetadata:  name: selenium-hubspec:  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/


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

apiVersion: apps/v1kind: Deploymentmetadata:  name: selenium-hubspec:  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: v1kind: Podmetadata:  name: selenium-hub  labels:    name: hubspec:  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: v1kind: ReplicationControllermetadata:  name: selenium-repspec:  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: v1kind: Servicemetadata:  name: selenium-srv  labels:    app: selenium-srvspec:  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.