Challenge 3: Speedrun - containerize and deploy the load testing application
Introduction
The testing team is putting their finishing touches on their load testing application, and they will need your help containerizing the code so that it can be scaled up in GKE. Your aim is to conduct a 100 player test against your game servers.
Description
In this challenge, you will containerize the load testing application for your Dungeon Crawl Stone Soup game servers, and deploy a 100 pod test using GKE.
Here is the test application code synthetic_player.py
This application uses Selenium with a Google Chrome webdriver to simulate player connectivity and interactions with the game. (note: at the time of course creation, running the apt-get -y --fix-broken install;
and repeating the dpkg -i google-chrome-stable_current_amd64.deb;
command were necessary to get the application to work.)
The install instructions:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb; \
dpkg -i google-chrome-stable_current_amd64.deb; \
apt-get -y --fix-broken install; \
dpkg -i google-chrome-stable_current_amd64.deb; \
pip3 install -r requirements.txt; \
requirements.txt:
selenium==4.11.2
webdriver-manager==4.0.0
To help you be successful, here are some reminders of things you will need to do:
- Create a node pool
- Create a deployment for your application and a service to direct traffic to it. Don’t forget the liveness and readiness probes!
- Create a namespace to help keep things organized
Note
- Use
e2-standard-2
nodes in your node pool as they will be the most cost effective, and if you run out of E2, use N2. Don’t worry about performance for this gHack! - The general GKE best practices are (note: there are always exceptions!):
- Don’t set CPU limits
- Set memory limit equal to memory request
- The load testing clients sometimes have connection issues, don’t be concerned if GKE shows you have 100 pods running, but your application only shows a handful
Success Criteria
- 100 test client pods spun up in a running state
- Navigate to the public endpoint of your service and login to see the list of bots playing the game. View one of their in-progress game sessions to see their attempt