Kubernetes has self-healing capabilities at the cluster level. It restarts containers that fail, reschedules pods when nodes die, and even kills containers that don't respond to your user-defined health checks.
In this section, we will perform application and cluster scaling tasks. You will learn how to use liveness and readiness probes to monitor container health and trigger a restart action in case of failures.
Make sure you have a Kubernetes cluster ready and kubectl and helm configured to manage the cluster resources.
How to do it…
This section is further divided into the following subsections to make this process easier:
- Testing self-healing pods
- Adding liveness probes to pods
Testing self-healing pods
In this recipe, we will manually remove pods in our deployment to show how Kubernetes replaces them. Later, we will learn how to automate this using a user-defined health check. Now, let's test Kubernetes' self...