This is a demo that can be used to show how resilient services running on Kubernetes can be.
Use either the version available at /next.html, or the more advanced version at /advanced.html.
-
Create Project in Cloud Console
-
Open Cloud Shell
-
Clone this repo
git clone https://github.com/roitraining/whack_a_pod
-
Run the following commands to set up the demo cluster/app:
cd whack_a_pod . ./setup.sh
It will take about 7 minutes for script to finished, and you will need to wait a good 5-7 minutes after the script is done for the Ingress to be functional.
- Find the pod external ip with
kubectl get ingress wap-ingress
- Visit
<ingress-ip>/advanced.html
- Click to deploy
- Show nodes and pods in GUI
- Show pod info in log pane on right side
- Kill one pod, show it terminating and then respawning in log pane
- Kill multiple pods and show them being replaced
- Kill one node and show all pods on another node
- Reinstate node and kill some nodes to show respawning on new node
- Show yaml files, etc.
- In Cloud Shell, run
. ./cleanup.sh
There are three Kubernetes services that make up the whole application:
- Game Game contains all of the front end clients for the game, both the carnival version and the Google Cloud Next version.
- Admin Admin contains all of the logic for managing the whole application. This is the application the front end calls to get a list of the pods running the color api, it also has calls to create and delete deployments, delete pods, and drain and uncordon nodes.
- Api Api contains two service calls: color and color-complete. Color is a random hexidecimal RGB color value. Color-complete is the same as color, but also sends the pod name of the pod that answered the service call.