<p>I wanted to know what kubernetes does to check liveness and readiness of a pod and container by default.</p>
<p>I could find the document which mentions how I can add my custom probe and change the probe parameters like initial delay etc. However, could not find the default probe method used by k8s.</p>

<p>By default, Kubernetes starts to send traffic to a pod when all the containers inside the pod start, and restarts containers when they crash. While this can be <code>good enough</code> when you are starting out, but you can make your deployment more robust by creating custom health checks.</p>

<blockquote>
  <p>By default, Kubernetes just checks container inside the pod is up and starts sending traffic. There is no by default readiness or liveness check provided by kubernetes.</p>
</blockquote>

<p><strong>Readiness Probe</strong></p>

<p>Let’s imagine that your app takes a minute to warm up and start. Your service won’t work until it is up and running, even though the process has started. You will also have issues if you want to scale up this deployment to have multiple copies. A new copy shouldn’t receive traffic until it is fully ready, but by default Kubernetes starts sending it traffic as soon as the process inside the container starts. By using a <code>readiness probe</code>, Kubernetes waits until the app is fully started before it allows the service to send traffic to the new copy.</p>

<p><strong>Liveness Probe</strong></p>

<p>Let’s imagine another scenario where your app has a nasty case of deadlock, causing it to hang indefinitely and stop serving requests. Because the process continues to run, by default Kubernetes thinks that everything is fine and continues to send requests to the broken pod. By using a liveness probe, Kubernetes detects that the app is no longer serving requests and restarts the offending pod.</p>
