Bitzu

KCNA ยท Storage and troubleshooting

Liveness, readiness and startup probes

Liveness, readiness, startup probes, restartPolicy, Pod phases and container states.

Key points

  • The kubelet runs probes against containers.
  • A failing liveness probe gets the container killed and restarted per restartPolicy.
  • A failing readiness probe marks the Pod not Ready and removes it from Service endpoints without restarting.
  • A startup probe holds off the other two until the app has started.

Source: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/

Practice questions

Single choice

Which probe failure removes a Pod from Service endpoints without restarting the container?

  1. None of them
  2. Readiness
  3. Liveness
  4. Startup
Show answer

Answer: B. Readiness

A failing readiness probe makes the Pod not Ready, so traffic stops, but the container keeps running. A liveness failure restarts the container instead.

Select all that apply

Which are valid probe mechanisms in Kubernetes?

  1. udpSocket
  2. icmpPing
  3. exec
  4. httpGet
  5. grpc
Show answer

Answer: C. exec, D. httpGet, E. grpc

Probes can use exec, httpGet, tcpSocket and grpc. udpSocket and icmpPing are not probe handlers.

True or false

True or false: when a readiness probe fails, the kubelet restarts the container.

Show answer

Answer: False

False. A readiness failure only marks the Pod not Ready and takes it out of Service endpoints. Restarts come from failed liveness or startup probes.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More KCNA topics in this module