<p>Pod lifecycle is managed by Kubelet in data plane.</p>
<p>As per the definition: If the liveness probe fails, the kubelet kills the container</p>
<p>Pod is just a container with dedicated network namespace &amp; IPC namespace with a sandbox container.</p>
<hr />
<p>Say, if the Pod is single app container Pod, then upon liveness failure:</p>
<ul>
<li>Does kubelet kill the Pod?</li>
</ul>
<p>or</p>
<ul>
<li>Does kubelet kill the container (only) within the Pod?</li>
</ul>

overexchange
<p>The kubelet uses liveness probes to know when to restart a container (<strong>NOT</strong> the entire Pod). If the liveness probe fails, the kubelet kills the container, and then the container may be restarted, however it depends on its <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" rel="nofollow noreferrer">restart policy</a>.</p>
<hr />
<p>I've created a simple example to demonstrate how it works.</p>
<p>First, I've created an <code>app-1</code> Pod with two containers (<code>web</code> and <code>db</code>).
The <code>web</code> container has a liveness probe configured, which always fails because the <code>/healthz</code> path is not configured.</p>
<pre><code>$ cat app-1.yml
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: app-1
  name: app-1
spec:
  containers:
  - image: nginx
    name: web
    livenessProbe:
      httpGet:
        path: /healthz
        port: 8080
        httpHeaders:
        - name: Custom-Header
          value: Awesome
  - image: postgres
    name: db
    env:
    - name: POSTGRES_PASSWORD
      value: example
</code></pre>
<p>After applying the above manifest and waiting some time, we can describe the <code>app-1</code> Pod to check that only the <code>web</code> container has been restarted and the <code>db</code> container is running without interruption:<br />
<strong>NOTE:</strong> I only provided important information from the <code>kubectl describe pod app-1</code> command, not the entire output.</p>
<pre><code>$ kubectl apply -f app-1.yml
pod/app-1 created
    
$ kubectl describe pod app-1
    
Name:         app-1
...
Containers:
  web:
...
    Restart Count:  4   &lt;--- Note that the &quot;web&quot; container was restarted 4 times
    Liveness:       http-get http://:8080/healthz delay=0s timeout=1s period=10s #success=1 #failure=3
...
  db:
...
    Restart Count:  0   &lt;--- Note that the &quot;db&quot; container works fine
...
Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
...
  Normal   Killing    78s (x2 over 108s)   kubelet            Container web failed liveness probe, will be restarted
...
</code></pre>
<p>We can connect to the <code>db</code> container to see if it is running:<br />
<strong>NOTE:</strong> We can use the <code>db</code> container even when restarting the<code> web</code> container.</p>
<pre><code>$ kubectl exec -it app-1 -c db -- bash
root@app-1:/#
</code></pre>
<p>In contrast, after connecting to the <code>web</code> container, we can observe that the liveness probe restarts this container:</p>
<pre><code>$ kubectl exec -it app-1 -c web -- bash
root@app-1:/# command terminated with exit code 137
</code></pre>
