Add Readiness and Liveness Probes

medium 20 XP ~8 minHands-on lab

The reviews Deployment in namespace catalogs has no health checks. During the last release, users hit Pods that were still warming up, and a Pod that hung overnight kept running until someone restarted it by hand. The application listens on port 8080 (named http).

Task

  • The app container of Deployment reviews has a readiness probe: an HTTP GET on path /ready, port 8080, every 10 seconds.
  • It has a liveness probe: a TCP check on port 8080 that starts after 30 seconds and fails the container after 3 failed attempts.
  • Every replica of reviews is updated and available, and the image and replica count stay as they are.

A practice cluster is running on this machine: start with kubectl get deploy reviews -n catalogs -o yaml.

About this machine

Ubuntu 24.04 with a private practice cluster: a real Kubernetes API server, scheduler and controllers, and three nodes (controlplane, node01, node02). Containers are simulated, so images never download and kubectl logs/exec are not available. k is an alias for kubectl, with completion. The grader checks the cluster's final state, not the commands you typed.

TerminalNot started

Your machine is ready to start

Create a free account to open a machine and get graded.