Exercise : 5 Selenium Grid Deployment with Helm - Raneesh02/ref_workshop_2 GitHub Wiki

This guide provides steps to deploy Selenium Grid on a Kubernetes cluster using Helm. The deployment includes the Selenium Hub, Selenium Node, and necessary services.

Prerequisites

  • Helm is installed on your system.
  • Kubernetes cluster is up and running.
  • Configuration files for Selenium Hub, Node, and Service are available.

Steps to Deploy Selenium Grid

1. Create Chart Yaml

Create a folders 'helm/selenium-grid' in root of the project

Chart.yaml

apiVersion: v2
name: selenium-grid
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

Documentation for chart.yaml : https://helm.sh/docs/topics/charts/

in the same directory 'helm/selenium-grid' create another files

values.yaml


image:
  hub: "selenium/hub:4.17.0-20240123"
  chrome: "selenium/node-chrome:latest"

for Arm Based OS like Mac values will be

image:
  hub: "seleniarm/hub:4.7.2-20221219"
  chrome: "seleniarm/node-chromium:latest"

Documentation for values.yaml : https://helm.sh/docs/chart_template_guide/values_files/

3. Replace image name for deployment config files for chrome and selenium hub and place them in helm folder -> selenium-grid -> templates

image: selenum/node-chrome:latest ==> image: {{ .Values.image.chrome }}

These values will now come from values.yaml

4. Install the helm chart

  • Go the directory having templates , chart.yaml, values.yaml:
    helm install selenium-grid ./selenium-grid
    
    
    

3. Rest of the steps for execution are same as kubernetes process

4. Update with a Values File

  • To apply new values from a values.yaml file to an active Helm deployment:
    helm upgrade selenium-grid ./selenium-grid -f path/to/your/values.yaml
    
    

5. Uninstall selenium grid with helm

helm uninstall selenium-grid

6 Check whether all the pods and services are down using kubectl

kubectl get pods
kubectl get services

Output for above command should not contain any resource for selenium grid

Optional Package your chart

helm package my-chart

above command will create a compressed tgz file which you can use to share with others