Selenium Grid is good for parallel execution but maintenance is a nightmare in an era where you see a frequent upgrades to browsers and corresponding drivers. No sooner the usage of automation framework / selenium grid increases, scalability and maintenance becomes a challenge. To address such issues, we do have solutions based on dockers, docker swarm etc. Having said that, there are some caveats in scaling, managing container health etc.
Below solution would try to address most of them. Major chunks of the solution include Selenium, Zalenium, Docker, Kubernetes and Amazon EKS.
This article would outline the process of deploying Selenium grid(Zalenium) on AWS (Amazon EKS) using Kubernetes and Helm.
What do we achieve with this setup..?
- Scalability: EKS can scale the nodes and pods as per the given configuration.
- Visibility: Zalenium provides a feature to view the live executions on the containers.
- Availability: Amazon EKS cluster makes selenium grid available all the time.
- Maintenance: Low maintenance as the containers are destroyed after each execution.
Pre-requisites:
- An active Amazon AWS account.
- IAM user is created in AWS account
- AWS CLI is connected to AWS account providing the user credentials using local powershell or any terminal
OR - Use AWS cloudshell which is automatically connected to logged in account.
- Install AWS CLI (for local terminal), kubectl, helm in the given order.
Lets Get Started!
First, Create cluster from AWS GUI.
- Open Amazon EKS console
- Choose Create Cluster
- Provide details like cluster name, k8s version, role
- Select VPC, security groups, endpoint access
- Further steps as shown on GUI which will make 'master' ready.
- Create Node Group (Amazon EC2) instances.
- Choose the cluster, to which the above node group should get attached.
- Select security group, resources etc.,
- Define min and max number no. of nodes.
Second, Create cluster using eksctl (The official CLI for Amazon EKS)