<p>I want to understand what happens behind the scene if a liveness probe fails in kubernetes ?</p>
<p>Here is the context:</p>
<p>We are using <em>Helm Chart</em> for deploying out application in Kubernetes cluster.</p>
<p>We have a statefulsets and headless service. To initialize mTLS, we have created a <em>'job'</em> kind and in 'command' we are passing shell &amp; python scripts are an arguments.</p>
<p>We have written a <em>'docker-entrypoint.sh'</em> inside <em>'docker image'</em> for some initialization work.</p>
<p>Inside statefulSet, we are passing a shell script as a command in <em>'livenessProbe'</em> which runs every 30 seconds.</p>
<p>I want to know if my livenessProbe fails for any reason :
1. Does helm chart monitor this probe &amp; 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 ?</p>
<p>How Kubernetes handles livenessProbe failure and what steps it takes?</p>

Pushpendra
<ol>
<li>It's not helm's responsibility.It's kubernetes's responsibility to restart the pod in case of readiness probe failure.</li>
<li>Yes  <code>docker-entryPoint.sh</code> is executed at container startup.</li>
<li>Job needs to be applied again to the cluster for it to execute. Alternatively you could use <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">initcontainer</a> which is guaranteed to run before the main container starts.</li>
<li>Kubelet kills the container and restarts it if liveness probe fails.</li>
</ol>
