Pod chaos monkey is a PoC of chaos engineering for Kubernetes which will help us to test the reliability of our system. It will kill pods (once at a time), in a desired namespace, in a schedule.
This PoC has been developed using Python 3.10
The project contains a Makefile to make easier the interaction with it.
Create a local environment to develop/test your python code.
$ make local-environment
Run unit tests
$ make unittest
Docker is mandatory because is a hard requirement of Kind.
$ make kind
Once that you have your Kubernetes cluster, you can create some pods:
$ kubectl run nginx1 --image=nginx
- ENVIRONMENT: Environment where the software will be running (KUBERNETES, LOCAL). By default: KUBERNETES.
- LOGGER_LEVEL: Level for the logger. By default: INFO
$ TAG=<desired tag> make docker-build
Your desired image will be loaded into the kubernetes node.
$ TAG=<desired tag> make load-image
It will install the helm chart with the default values.
$ make helm-install
Helm chart values file contains the docker image, cron value and namespace where the pods will be removed. You can apply your own values.
example:
image: pod-chaos-monkey:latest
schedule: "* * * * *"
namespace: default
$ make destroy