Naive http app for testing Kubernetes' liveness/readiness probes
344
Kubster is a simple http server that can be used to demonstrate k8s liveness and readiness probes' concept.
GET / - always returns 200 OK and print nice k8s logoGET /live - returns 200 OK (default) or 503 Service Unavailable (if set)GET /ready - returns 503 Service Unavailable after start, changes to 200 OK after
KUBSTER_READYDELAY number of seconds (default), or can be overridenGET /set?live=<true|false>&ready=<true|false> - override /live and /ready endpoint
responses (true for 200 OK, false for 503 Service Unavailable)Environment variables:
KUBSTER_BIND - host:port to bind to and listen onKUBSTER_READYDELAY - number of seconds before the /ready endpoint starts succeedingClone this repo and make it your current working directory first.
# Create the pod first, the pod name will be kubster-pod
kubectl apply -f manifests/pod.yaml
# Run multiple times to observe how pods gets ready after 30 seconds from launching
kubectl describe pod kubster-pod
# You can use port forwarding to access the http server and view/modify the responses
kubectl port-forward kubster-pod 8080:8080 &
curl -s localhost:8080/
curl -sv localhost:8080/live
curl -sv localhost:8080/ready
# Make kubernetes restart the pod
curl -s localhost:8080/set?live=false
Content type
Image
Digest
Size
5.3 MB
Last updated
almost 8 years ago
docker pull wigwam/kubster