Reputation: 55
I want to understand what happens behind the scene if a liveness probe fails in kubernetes ?
Here is the context:
We are using Helm Chart for deploying out application in Kubernetes cluster.
We have a statefulsets and headless service. To initialize mTLS, we have created a 'job' kind and in 'command' we are passing shell & python scripts are an arguments.
We have written a 'docker-entrypoint.sh' inside 'docker image' for some initialization work.
Inside statefulSet, we are passing a shell script as a command in 'livenessProbe' which runs every 30 seconds.
I want to know if my livenessProbe fails for any reason : 1. Does helm chart monitor this probe & will restart container or it's K8s responsibility ? 2. Will my 'docker-entryPoint.sh' execute if container is restarted ? 3. Will 'Job' execute at the time container restart ?
How Kubernetes handles livenessProbe failure and what steps it takes?
Upvotes: 0
Views: 688
Reputation: 91
To answer your question liveness probe and readiness probe are actions basically get calls to your application pod to check whether it is healthy. This is not related to helm charts. Once the liveness or readiness probe fails container restart takes place . I would say these liveness probes failure can affect your app uptime, so use a rolling deployment and autoscale your pod counts to enable availability.
Upvotes: 4
Reputation: 44687
docker-entryPoint.sh
is executed at container startup.Upvotes: 4