{"id":15651022,"url":"https://github.com/srinivasantarget/kubegrid","last_synced_at":"2025-04-30T18:21:39.422Z","repository":{"id":69803126,"uuid":"90661703","full_name":"SrinivasanTarget/KubeGrid","owner":"SrinivasanTarget","description":"KubeGrid - Kubernetes way of orchestrating Docker-Selenium Grid","archived":false,"fork":false,"pushed_at":"2017-05-08T19:18:23.000Z","size":370,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T18:43:55.949Z","etag":null,"topics":["docker-selenium","kubernetes","kubernetes-selenium","minikube","minikube-selenium","selenium-grid"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SrinivasanTarget.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-08T18:50:24.000Z","updated_at":"2023-03-06T09:14:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b4b193f-2842-4528-9697-c0234d79a33b","html_url":"https://github.com/SrinivasanTarget/KubeGrid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrinivasanTarget%2FKubeGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrinivasanTarget%2FKubeGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrinivasanTarget%2FKubeGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrinivasanTarget%2FKubeGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SrinivasanTarget","download_url":"https://codeload.github.com/SrinivasanTarget/KubeGrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251758244,"owners_count":21639003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-selenium","kubernetes","kubernetes-selenium","minikube","minikube-selenium","selenium-grid"],"created_at":"2024-10-03T12:36:39.154Z","updated_at":"2025-04-30T18:21:39.389Z","avatar_url":"https://github.com/SrinivasanTarget.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeGrid\nKubeGrid - Kubernetes way of orchestrating Docker-Selenium Grid\n\n## Kubernetes\nKubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.\n\n### Basics of Kubernetes\n  - Pods\n  - Replication controllers\n  - Services\n  - Deployments\n\n### pods\nBasic unit of kubernetes workloads.Pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers.\n\n### Replication controllers\nReplicationController makes sure that a pod or homogeneous set of pods are always up and available.\n\n### Services\nservice provides a stable endpoint for group of pods managed by a replication controller\n\nThere are several ways of orchestrating a selenium grid using kubernetes\n1. Using Minikube (local solution)\n2. Using Google Container Registry (cloud solution)\n    - Self-healing capability\n3. Using kompose (docker-compose equivalent)\n\n## Minikube\nMinikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.\n\n### Launching selenium hub\n```sh\n$ kubectl run selenium-hub --image selenium/hub:3.3.1 --port 4444\ndeployment \"selenium-hub\" created\n$ kubectl get pods\nNAME                          READY     STATUS    RESTARTS   AGE\nselenium-hub-53154924-tkz4j   1/1       Running   0          43s\n```\nExpose selenium hub to be accessible\n```sh\n$ kubectl expose deployment selenium-hub --type=NodePort\nservice \"selenium-hub\" exposed\n$ kubectl get services\nNAME           CLUSTER-IP   EXTERNAL-IP   PORT(S)          AGE\nkubernetes     10.0.0.1     \u003cnone\u003e        443/TCP          2m\nselenium-hub   10.0.0.186   \u003cnodes\u003e       4444:32077/TCP   46s\n```\nSelenium hub Url can be accessed through,\n```sh\n$ minikube service selenium-hub --url\nhttp://192.168.99.100:32077\n```\n### Spin up Chrome Node\n```sh\n$ kubectl run selenium-node-chrome --image selenium/node-chrome:3.3.1 --env=\"HUB_PORT_4444_TCP_ADDR=selenium-hub\" --env=\"HUB_PORT_4444_TCP_PORT=4444\"\ndeployment \"selenium-node-chrome\" created\n$   kubectl get pods\nNAME                                    READY     STATUS              RESTARTS   AGE\nselenium-hub-53154924-tkz4j             1/1       Running             0          7m\nselenium-node-chrome-1222720312-tmx92   0/1       ContainerCreating   0          31s\n```\n### Scaling\n```sh\n$ kubectl scale deployment selenium-node-chrome --replicas=4\ndeployment \"selenium-node-chrome\" scaled\n$  kubectl get pods\nNAME                                    READY     STATUS    RESTARTS   AGE\nselenium-hub-53154924-tkz4j             1/1       Running   0          10m\nselenium-node-chrome-1222720312-b0vvs   1/1       Running   0          9s\nselenium-node-chrome-1222720312-j2xs6   1/1       Running   0          9s\nselenium-node-chrome-1222720312-s7n2r   1/1       Running   0          9s\nselenium-node-chrome-1222720312-tmx92   1/1       Running   0          3m\n```\n![alt tag](images/Minikube_Grid_Console.png)\n\n### Minikube Dashboard\n```sh\n$ minikube dashboard\n```\n![alt tag](images/Minikube_Dashboard.png)\n\n## Using Google Container Registry\nGoogle Container Engine is also a quick way to get Kubernetes up and running: https://cloud.google.com/container-engine/\nYour cluster must have 4 CPU and 6 GB of RAM to complete the example up to the scaling portion.\n### Create Selenium Hub\n```sh\n$ kubectl create -f selenium-hub-rc.yml\n```\nLets create a service for nodes to connect to,\n```sh\n$ kubectl create -f selenium-hub-service.yml\n```\nSelenium hub can be exposed to public to access the hub,\n```sh\n$ kubectl expose rc selenium-hub --name=selenium-hub-external --labels=\"app=selenium-hub,external=true\" --type=LoadBalancer\n```\nExposing a selenium hub to public is not secure and preferrable. It is intended here just for a showcase,\n```\n$ kubectl get services\n```\n### Spin up Chrome \u0026 Firefox Nodes\nNow since hub is up and exposed lets spin up nodes and register into hub,\n```sh\n$ kubectl create -f selenium-node-chrome-rc.yml\n$ kubectl create -f selenium-node-firefox-rc.yml\n```\nNow nodes are up and registered to hub created above can be seen in exposed selenium-hub's console.\n## Self-Healing Capability\nOne of the greatest adavantage of kubernetes is Self healing.Though docker-swarm also supports self-healing, kubernetes is more reliable solution over a period of time due to replication controllers.\nTo demonstrate lets get the list of pods created,\n```sh\n$ kubectl get pods\nNAME                         READY     STATUS    RESTARTS   AGE\nselenium-hub-6m8v1           1/1       Running   1          1h\nselenium-node-chrome-p6fkn   1/1       Running   0          1h\nselenium-node-chrome-pv46k   1/1       Running   0          1h\n```\nLet's delete a google chrome node using below command,\n```sh\n$ kubectl delete pod selenium-node-chrome-pv46k\npod \"selenium-node-chrome-pv46k\" deleted\n```\nNow again get list of pods (chrome nodes),\n```sh\n$ kubectl get pods\nNAME                         READY     STATUS    RESTARTS   AGE\nselenium-hub-6m8v1           1/1       Running   2          1h\nselenium-node-chrome-p6fkn   1/1       Running   0          1h\nselenium-node-chrome-phb0c   1/1       Running   0          50s\n```\nWe can see that within few seconds selenium hub replication controller automatically generates a new chrome node or pod ```selenium-node-chrome-phb0c ``` and assigns itself.\nReplication Controller is one of the greatest asset of kubernetes to manage nodes automatically in a cluster.\n\n## kompose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrinivasantarget%2Fkubegrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrinivasantarget%2Fkubegrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrinivasantarget%2Fkubegrid/lists"}