Using Probes in Docker Kubernetes Service

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Probes are a great tool for making some applications more resilient in Kubernetes. In this lab, you will have the opportunity to explore how to use probes to make Kubernetes react more quickly to application failures. This will help you design more robust applications in your Kubernetes clusters!

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Get the Pod Definition
  1. Look for the Pod called webserver and get a copy of its YAML definition.
Add a Probe to the Pod
  1. Edit the Pod YAML so that it contains a probe that is able to detect when the Pod has stopped working. You can determine the pod’s health by making an http request to / on port 8080 on the pod.

Additional Resources

Your company is exploring using Docker Kubernetes Service to manage some applications.

They have a Pod called webserver that has been running on the Docker Kubernetes cluster for awhile, but unfortunately the Pod periodically stops working and needs to be restarted. While the developers are looking into why the Pod keeps breaking, your job is to build some automation in Kubernetes to automatically restart the Pod when it becomes unhealthy.

Since this is a stand-alone Pod, you will need to delete and re-create the Pod in order to make the necessary changes. Obtain the existing Pod definition from UCP and change it so that Kubernetes is able to detect when the Pod is unhealthy. Then, delete and re-create the Pod.

Note: You can access UCP at https://<UCP_MANAGER_PUBLIC_IP>. You can log in to the UCP using the username admin and the randomly-generated password associated with any of the lab servers.

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?