Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added kubernetes deployment yml for selenium grid 4 * fixed typo in the comments section of k8s yml. * added k8s deployment instructions in README.md * added github action to test on minikube
- Loading branch information
Showing
4 changed files
with
489 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Test Selenium Grid 4 deployment on Minikube Cluster" | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
pull_request: | ||
branches: | ||
- trunk | ||
|
||
jobs: | ||
deploy: | ||
name: Deployment and testing of Grid 4 on Minikube | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Setup Minikube | ||
uses: manusa/actions-setup-minikube@v2.0.1 | ||
with: | ||
minikube version: "v1.13.1" | ||
kubernetes version: "v1.19.2" | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
driver: none | ||
- name: Interact with Minikube | ||
run: kubectl get nodes | ||
- name: Output Cluster info | ||
run: | | ||
kubectl cluster-info | ||
kubectl get pods -n kube-system | ||
echo "current-context:" $(kubectl config current-context) | ||
echo "environment-kubeconfig:" ${KUBECONFIG} | ||
- name: Deploy Grid4 on minikube | ||
run: kubectl apply -f k8s-deployment-full-grid.yaml | ||
- name: Expose Router service | ||
run: kubectl expose deployment selenium-router-deployment --type=NodePort --port=4444 --target-port=4444 | ||
- name: Wait for Pods to get started | ||
run: | | ||
sleep 10 | ||
podsCount=$(kubectl get pods -l component=selenium-grid-4 | wc -l) | ||
ctr=0 | ||
while [ $podsCount -lt 6 ] | ||
do | ||
((ctr++)) | ||
if [[ $ctr -eq 30 ]]; then | ||
echo "Timed out while waiting for Pods to get ready" | ||
exit 1 | ||
fi | ||
echo "Waiting for pods to get started...." | ||
sleep 10 | ||
podsCount=$(kubectl get pods -l component=selenium-grid-4 | wc -l) | ||
done | ||
echo "All the pods are started" | ||
- name: Waiting for Pods to get ready | ||
run: | | ||
echo "Waiting for pods to attain ready state...." | ||
kubectl wait --for=condition=ready pod -l name=selenium-router --timeout=300s | ||
kubectl wait --for=condition=ready pod -l name=selenium-distributor --timeout=300s | ||
kubectl wait --for=condition=ready pod -l name=selenium-event-bus --timeout=300s | ||
kubectl wait --for=condition=ready pod -l name=selenium-chrome-node --timeout=300s | ||
kubectl get pods -l component=selenium-grid-4 | ||
echo "All pods are in ready state now" | ||
- name: Listing all the Grid 4 components | ||
run: kubectl get all -l component=selenium-grid-4 | ||
- name: Testing the Grid | ||
run: | | ||
SELENIUM_GRID_URL=$(minikube service selenium-router-deployment --url) | ||
echo $SELENIUM_GRID_URL | ||
python3 $PWD/tests/K8sSmokeTest.py $SELENIUM_GRID_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.