<p>In k8s, a pod starts with a container named <code>pause</code>.<br />
Pause container helps other containers share network namespace.<br />
I know it but have a question.</p>
<p>What is the lifecycle of the pause container?<br />
What I want to know is that when a pod gets <code>crashloopbackoff</code> or temporally doesn't work, does the pause container also stop?</p>
<p>If not, does the pause container maintains its own Linux namespace?</p>

Togomi
<blockquote>
<p>When a pod gets <code>crashloopbackoff</code> or temporally doesn't work, does the pause container also stop?</p>
</blockquote>
<p>No. A <a href="https://sysdig.com/blog/debug-kubernetes-crashloopbackoff/" rel="nofollow noreferrer">CrashloopBackOff</a> is independent of <code>pause</code> containers. I have reproduced this situation in Minikube with docker driver with following yaml:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: dummy-pod
spec:
  containers:
    - name: dummy-pod
      image: ubuntu
  restartPolicy: Always
</code></pre>
<p>Command <code>kubectl get pods</code> returns for me:</p>
<pre><code>NAME        READY   STATUS             RESTARTS         AGE
dummy-pod   0/1     CrashLoopBackOff   7 (2m59s ago)    14m
</code></pre>
<p>Then I have logged into the node on which the crashed pod exist and run <code>docker ps</code>:</p>
<pre><code>CONTAINER ID   IMAGE                  COMMAND                  CREATED         STATUS         PORTS     NAMES
7985cf2b01ad   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 14 minutes ago   Up 14 minutes             k8s_POD_dummy-pod_default_0f278cd1-6225-4311-98c9-e154bf9b42a3_0
18eeb073fe71   6e38f40d628d           &quot;/storage-provisioner&quot;   16 minutes ago   Up 16 minutes             k8s_storage-provisioner_storage-provisioner_kube-system_5c3cec65-5a2d-4881-aa34-d98e1098f17f_1
b7dd2640584d   8d147537fb7d           &quot;/coredns -conf /etc…&quot;   17 minutes ago   Up 17 minutes             k8s_coredns_coredns-78fcd69978-h28mp_kube-system_f62eec5a-290c-4a42-b488-e1475d7f6ff2_0
d3acb4e61218   36c4ebbc9d97           &quot;/usr/local/bin/kube…&quot;   17 minutes ago   Up 17 minutes             k8s_kube-proxy_kube-proxy-bf75s_kube-system_39dc64cc-2eab-497d-bf13-b5e6d1dbc9cd_0
083690fe3672   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_coredns-78fcd69978-h28mp_kube-system_f62eec5a-290c-4a42-b488-e1475d7f6ff2_0
df0186291c8c   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_kube-proxy-bf75s_kube-system_39dc64cc-2eab-497d-bf13-b5e6d1dbc9cd_0
06fdfb5eab54   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_storage-provisioner_kube-system_5c3cec65-5a2d-4881-aa34-d98e1098f17f_0
183f6cc10573   aca5ededae9c           &quot;kube-scheduler --au…&quot;   17 minutes ago   Up 17 minutes             k8s_kube-scheduler_kube-scheduler-minikube_kube-system_6fd078a966e479e33d7689b1955afaa5_0
2d032a2ec51d   f30469a2491a           &quot;kube-apiserver --ad…&quot;   17 minutes ago   Up 17 minutes             k8s_kube-apiserver_kube-apiserver-minikube_kube-system_4889789e825c65fc82181cf533a96c40_0
cd157b628bc5   6e002eb89a88           &quot;kube-controller-man…&quot;   17 minutes ago   Up 17 minutes             k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_f8d2ab48618562b3a50d40a37281e35e_0
a2d5608e5bac   004811815584           &quot;etcd --advertise-cl…&quot;   17 minutes ago   Up 17 minutes             k8s_etcd_etcd-minikube_kube-system_08a3871e1baa241b73e5af01a6d01393_0
e9493a3f2383   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_kube-apiserver-minikube_kube-system_4889789e825c65fc82181cf533a96c40_0
1088a8210eed   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_kube-scheduler-minikube_kube-system_6fd078a966e479e33d7689b1955afaa5_0
f551447a77b6   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_etcd-minikube_kube-system_08a3871e1baa241b73e5af01a6d01393_0
c8414ee790d8   k8s.gcr.io/pause:3.5   &quot;/pause&quot;                 17 minutes ago   Up 17 minutes             k8s_POD_kube-controller-manager-minikube_kube-system_f8d2ab48618562b3a50d40a37281e35e_0
</code></pre>
<p>The <code>pause</code> containers are independent in the pod. The pause container is a container which holds the network namespace for the pod. It does nothing. It doesn't stop even if the pod is in the CrashLoopBackOff state. If the pause container is dead, kubernetes consider the pod died and kill it and reschedule a new one. There was no such situation here.</p>
<p>See also an <a href="https://stackoverflow.com/questions/48651269/what-are-the-pause-containers">explanation of <code>pause</code> containers</a>.</p>
