Table of contents
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 Request | httpget path:/health-status |
3. Check using TCP | tcpSocket 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.
Reference: https://github.com/m3pratik/31daysofEKS/
Made with ❤️ by Pratikkumar Panchal. github.com/m3pratik/31daysofEKS