The Kubernetes Self-Healing Simulator is a Python CLI tool designed to demonstrate the self-healing capabilities of Kubernetes that I developed for customer workshops. It allows users to delete a pod from a list of running pods and then watch as Kubernetes automatically recreates the pod, showcasing the system's resilience.
- List all running pods in a specified namespace.
- Delete a selected pod and observe Kubernetes' response to maintain the desired state.
- Watch and display events related to the pod's recreation process.
- Python 3.6+
- Kubernetes cluster (Minikube or any cloud-based Kubernetes service)
- kubectl configured to connect to your Kubernetes cluster
- Kubernetes Python client
- Clone this repository:
git clone https://github.com/yourusername/kubernetes-self-healing-simulator.git
- Navigate to the project directory:
cd kubernetes-self-healing-simulator
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install the required dependencies:
pip install -r requirements.txt
- Ensure your
kubectl
is configured and points to the desired Kubernetes cluster. - Run the simulator:
python src/simulator.py
- Follow the on-screen prompts to select and delete a pod. Observe the self-healing process through event logs.