Day 15 Liveness Probe | Kubernetes

Day 15 Liveness Probe | Kubernetes

Hello again, this time we take a look at various probes provided by Kubernetes.

What is Liveness Probe?

The Liveness probe lets Kubernetes know when to restart a container.

There are many cases where the container having issues and the container is running but not serving the needs due to deadlock or any other problem like DB connection failure. restarting a container helps in such states.

Ways to define probes!

1. Check using Commands/bin/sh -c nc -z localhost 3000
2. Check using HTTP Get Requesthttpget path:/health-status
3. Check using TCPtcpSocket Port:3000
          livenessProbe:
            exec:
              command:
                - /bin/sh
                - -c
                - nc -z localhost 3000
            initialDelaySeconds: 60
            periodSeconds: 10

In the above deployment, we defined liveness prob, it will exec the command to check the status of that service.

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