Simple webapp to demonstrate kubernetes health check failures & rolling deployments
kubectl create deployment test --image=rmenn/kping:0.0.1
on minikube
kubectl expose deployment test --port=80 --type=LoadBalancer
minikube service test
on docker-for-mac
kubectl expose deployment test --port=80 --type=NodePort
Running this in a split terminal will show you the real time updates
while true; do curl -m 0.5 -w "\t %{http_code} \n" <your_endpoint>/ping; done
Edit the manifest and update the image in the container spec
kubectl edit deployment/test
You should see a few timeouts occuring
health checks should remove the container from the service when it returns a non 2XX-3XX responce
to test this
curl -X POST <endpoint>/healthz
this will set the healthz endpoint to return an internal server error the pod will be restarted