Defining liveness and readiness
Container orchestration systems such as Kubernetes and Docker Swarm make it significantly easier to deploy, run, and update highly distributed, mission-critical applications. The orchestration engine automates many cumbersome tasks, such as scaling up or down, asserting that the desired state is maintained at all times, and more.
However, the orchestration engine cannot just do everything automatically. Sometimes, we developers need to support the engine with some information that only we can know about. So, what do I mean by that?
Let’s look at a single application service. Let’s assume it is a microservice and let’s call it service A. If we run service A containerized on a Kubernetes cluster, then Kubernetes can make sure that we have the five instances that we require in the service definition running at all times. If one instance crashes, Kubernetes can quickly launch a new instance and thus maintain the desired state....