Day 16 Readiness Probe | Kubernetes

Day 16 Readiness Probe | Kubernetes

Yesterday in this blog https://m3pratik.hashnode.dev/day-15-liveness-probe-kubernetes we talk about types of probes, in that blog, we learn how to use liveness probes to make applications up all the time.

In today's blog, we will learn about Readiness Probe!

What is the readiness probe?

The kubelet is an important part of a Kubernetes cluster, as it is responsible for managing the pods, containers, and other resources. It ensures that containers are running, healthy, and ready to accept traffic. This is done by using readiness probes.

A readiness probe is a signal used to detect when a container is ready to start accepting traffic. The kubelet uses this signal to determine which pods are ready to be used as backends for services. If a pod is not ready, then it is removed from the service load balancers. This is important because it prevents traffic from being routed to a pod that is not ready to handle it.

How to use the readiness probe?

          readinessProbe:
            httpGet:
              path: /login #this path can be different.
              port: 3000
            initialDelaySeconds: 60
            periodSeconds: 10

In the above readiness probe, we use path : /login and method httpGet so that it can send get request to the current pod's endpoint and check the status, if response is not 200 it will show as not ready state and the container will restart.

Made with ❤️ by Pratikkumar Panchal. github.com/m3pratik/31daysofEKS