Kubernetes: Readiness Check with httpGet Kubernetes: Readiness Check with httpGet kubernetes kubernetes

Kubernetes: Readiness Check with httpGet


You have typo.. you said :

Once the readiness check returns 500, the server will stop serving traffic.

However, it should be :

Once the readiness check returns 500, the k8s service will stop serving traffic.

enter image description here

k8s service behaves like a load balancer for multi-pods.

  • If pod is ready, an endpoint will be created for the ready pod, and the traffic will be received.
  • If pod is not ready, its endpoint will be removed and it will not more receive traffic.

While Readiness Probe decides to forward traffic or not, Liveness Probe decides to restart the Pod or not.

If you want to get rid off unhealthy Pod, you have to specify also Liveness Probe.

So let's summarize:

To get full HA deployment you need 3 things together:

  • Pod are managed by Deployment which will maintain a number of replicas.
  • Liveness Probe will help to remove/restart the unlheathy pod.. After somtime ( 6 restarts), the Pod will be unhealthy and the Deployment will take care to bring new one.
  • Readiness Probe will help forward traffic to only ready pods : Either at beginning of run, or at the end of run ( graceful shutdown).