Why Kubernetes container probes are important for you as K8s Admin?

Kubernetes probe feature image.
probe
/prəʊb/
(verb) physically explore or examine (something) with the hands or an instrument.

Imagine you have a couple of kubernetes Deployments running on your k8s cluster and have k8s service attached to it. So far it’s running smoothly and you are enjoying these times.

Now, your dev team is releasing a newer version of these apps every week. To achieve the 99.999% (“five nines”) SLA we have to make sure that we perform rolling updates.

Here comes the real problem.

Just after performing rolling updates, our app crashes for a couple of seconds before working normally.

What might be the reason for this unusual behavior? 🤔

As you might have guessed, the moment our app container starts pod goes to a ready state and k8s attaches IP to it and since service is attached, k8s starts sending traffic to your app

But in our case even though the container is up, our app is not ready yet, it’s still starting the server and/or making some pre-requisite DB connections/ task queue connections, etc.

So now we know when we perform a rolling update, our app won’t respond for a few seconds as it’s still restarting its server and k8s is sending the traffic to it.

What is the solution?

Introducing k8s container probes.

Kubernetes health checkup image

Kubernetes has 3 types of container probes to determine the health of container,

  • Liveness Probe
  • Readiness Probe
  • Startup Probe

As the name suggests, to check if our app is ready to accept traffic, we will use the Readiness probe as the solution to our problem.

We’ll discuss the “How” part in the later series of the blog. Make sure to sign our newsletter and connect with us on our social media accounts.

Let’s take a look at what these probes actually are.

Liveness Probe

To determine when to restart our container, the Kubelet employs liveness probes. Liveness probes, for example, could detect a deadlock, in which our application is running but unable to progress. Restarting a container in this state can assist in making our application more available despite having bugs.

Readiness Probe

To determine when our container is ready to accept traffic, the Kubelet employs readiness probes. This signal can be used to control Pods that are used as backend services and may take some time to load its server. When a Pod is not ready, it is removed from the load balancers of the Service.

Startup Probe

To determine when our container application has begun, the Kubelet employs startup probes. If this is configured, it disables liveness and readiness checks until it succeeds, ensuring that other probes do not interfere with our application startup. This can be used to implement liveness checks on slow-starting containers, preventing them from being killed by the Kubelet before they are up and running.


These were the basic definitions of each probe, I hope you got the idea of k8s probes and their uses. We’ll take a deeper dive into each of these probes in the upcoming blogs.

Also, Take a look at what else we do.

Share your love
Abu Taha
Abu Taha
Articles: 4

Leave a Reply

Your email address will not be published. Required fields are marked *