Implement Health Checks for Kubernetes in Your Application

Mattias te Wierik
The Startup
Published in
11 min readSep 6, 2020

--

Making your application more resilient with health checks

Over the past year containerizing applications has become an extremely popular practice to quickly develop, ship and deploy applications. With the help of containerization tools like Docker, the desired container environment can be described in a declarative manner.

With Kubernetes, containerized applications can be deployed, scaled when needed, and further managed. Kubernetes has self-healing powers for containers — but only works to it’s fully potential when it’s set up right.

In this article, we are going to implement health checks and corresponding probes so that Kubernetes is able to define whether a containerized application is healthy and can act accordingly.

The implementation examples on the application side are implemented with .NET Core. The theory and implementations can be as well applied to Java/Spring Boot applications. Spring Boot offers the Actuator module to implement comparable functionality that is stated further into this article.

What are Kubernetes probes?

To understand what a probe in Kubernetes context is, it is smart to take a step back and look into what the definition of the word:

--

--