Implementing Health Checks in a Kubernetes Application

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Kubernetes health checks provide a deeper level of control over how Kubernetes detects the state of your application containers. In this lab, you will work closely with health checks using Kubernetes probes to fine-tune how Kubernetes manages containers.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Add a Liveness Probe

The comb-dashboard Deployment can be found in the hive Namespace.

Edit the Deployment so that the containers are automatically restarted whenever they begin responding to HTTP requests with an error status code.

The container application listens on port 80, and you can use the root path / to test whether the bug is occurring.

Add a Readiness Probe

You can find the comb-monitor in the hive Namespace.

Edit this Deployment and add a probe that will verify that the application can execute command-line commands before the container is considered ready.

You can use a simple command like echo This is a test!.

Additional Resources

Welcome to HiveCorp, a software design company that is totally not run by bees!

We have recently deployed a new set of tools to our Kubernetes cluster, but there are some problems that need to be resolved.

One component called comb-dashboard is an application that serves HTTP requests. A bug in the code is causing it to randomly begin responding with error status codes, but the container process continues to run. Currently, the only way to fix the issue when it arises is to restart the application. Implement a probe that will cause the container to be automatically restarted when it begins responding with errors.

Another component, comb-monitor, is entering the ready status too early, before it has a chance to fully start up. Create a probe that will detect when the container is fully started up by running a test command.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?