What are the pause containers?
Asked Answered
D

5

42

In my IBM Cloud Private, I see several pause containers.

Can anyone explain the purpose of these? Normally, I can get to the bash shell in a running container but not the ones which are pause.

# docker ps | grep pause
ee5f3f6b9fc0        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_catalog-catalog-apiserver-8qxrf_kube-system_3b4b107d-0b72-11e8-9f22-005056227136_0
d238dad0c5b8        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_auth-apikeys-bk28g_kube-system_3b731880-0b72-11e8-9f22-005056227136_0
0196efb043ca        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_icp-router-htnhz_kube-system_3b8d25d3-0b72-11e8-9f22-005056227136_0
b09dc1759d09        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_unified-router-bskb6_kube-system_3af9d44e-0b72-11e8-9f22-005056227136_0
8a392f174c24        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_auth-pap-gfh7q_kube-system_3aa5b311-0b72-11e8-9f22-005056227136_0
0ac776eb9ced        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_platform-api-zr5pz_kube-system_3b2ce527-0b72-11e8-9f22-005056227136_0
107896ebfcd6        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_icp-ds-0_kube-system_3a9200f8-0b72-11e8-9f22-005056227136_0
f95df5fbcc4a        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_image-manager-0_kube-system_3ae74f5c-0b72-11e8-9f22-005056227136_0
a9d30804f222        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_auth-idp-h4fmt_kube-system_3ad78a99-0b72-11e8-9f22-005056227136_0
eaae55900637        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_catalog-ui-jv9sq_kube-system_3af5cb32-0b72-11e8-9f22-005056227136_0
4ace18a84d8b        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_auth-pdp-9vhzx_kube-system_3ae0a074-0b72-11e8-9f22-005056227136_0
98b70f6074c7        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_calico-policy-controller-5997c6c956-cx774_kube-system_39bfecef-0b72-11e8-9f22-005056227136_0
63a0340e3de8        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_rescheduler-jqtd4_kube-system_3a6d4b05-0b72-11e8-9f22-005056227136_0
cace008e71b1        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_kube-dns-9494dc977-7gwpx_kube-system_39a15b6b-0b72-11e8-9f22-005056227136_0
80a18b538ef3        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_platform-ui-k5g7h_kube-system_3a98aad3-0b72-11e8-9f22-005056227136_0
bea43bfc8d70        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_catalog-catalog-controller-manager-bd9f49c8c-4fqcp_kube-system_39653745-0b72-11e8-9f22-005056227136_0
f54f329e50ae        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_helm-api-5d8b6d6f9c-4rl2s_kube-system_396ade8d-0b72-11e8-9f22-005056227136_0
6812e3fee9cc        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_tiller-deploy-55fb4d8dcc-pcxbj_kube-system_396b0005-0b72-11e8-9f22-005056227136_0
69a840bc394b        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_helmrepo-5878d9d858-wlcrj_kube-system_396506a5-0b72-11e8-9f22-005056227136_0
03bc9ce0413d        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_heapster-5fd94775d5-28t6w_kube-system_396b0dd6-0b72-11e8-9f22-005056227136_0
8763167695b3        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_filebeat-ds-amd64-q54pc_kube-system_9b8515d6-0b52-11e8-99a8-005056227136_1
461e5de11ee1        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_calico-node-amd64-ql292_kube-system_53492619-0b51-11e8-99a8-005056227136_1
f73e2eb9dbaf        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_k8s-master-192.168.142.103_kube-system_c39080358687c72432da5f6de4b6fff9_1
c08f029af60e        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_k8s-mariadb-192.168.142.103_kube-system_6b640df7dae2cb064ebc450b273ce62a_1
0174b5c35963        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_k8s-proxy-192.168.142.103_kube-system_b9f441de4995384d245d71fdb65e2cc2_1
f6befd10c479        ibmcom/pause:3.0    "/pause"                 About an hour ago   Up About an hour                        k8s_POD_k8s-etcd-192.168.142.103_kube-system_a5150d8f6ee1f8047b05f9b2d5cbcaba_1
Discretionary answered 6/2, 2018 at 20:18 Comment(0)
S
59

The 'pause' container is a container which holds the network namespace for the pod. Kubernetes creates pause containers to acquire the respective pod’s IP address and set up the network namespace for all other containers that join that pod.

You can access below links for details.

https://groups.google.com/forum/#!topic/kubernetes-users/jVjv0QK4b_o

https://www.ianlewis.org/en/almighty-pause-container

Sade answered 7/2, 2018 at 2:13 Comment(1)
does pause container run+complete its execution before other containers start?Reinforce
M
8

Pause is a secret container that runs on every pod in Kubernetes. This container’s primary job is to keep the namespace open in case all the other containers on the pod die.

Mariomariology answered 27/11, 2019 at 9:44 Comment(0)
S
6

yes, the pause container is part of each pod that is responsible to create shared network, assign ip address within the pod for all business containers inside this pod, also the pause container shared the volume for entire pod. If the pause container is dead, kubernetes consider the pod died and kill it and reschedule a new one.

Sullyprudhomme answered 8/2, 2018 at 8:5 Comment(0)
S
6

If you docker stop the pause container, you would find that the Pod would have a new internal IP without any change in Restart count of the Pod. However, if you docker stop the container of the Pod, you would find the Pod status as Completed and then if you would docker start the same, you would find Pod in Running again with Restart count of the Pod incremented by 1 with no change in IP.

Subserve answered 11/10, 2019 at 12:0 Comment(0)
C
1

Let me explain much more simpler way in points.

1. The pause container is an infrastructure container that holds all the containers of a pod together.

2. It provides a way for all containers in a pod to share the same network and other Linux namespaces. The user-defined application containers in the pod use the namespaces of the pause container.

3. The pause container's lifecycle is tied to the pod's lifecycle, running from the time the pod is scheduled until it is deleted.

4. If the pause container is killed, the Kubelet recreates it so that the other containers can rejoin the same namespaces.

5. This allows application containers to be restarted and still become part of the same namespaces as before.

I hope this helps very much.

Chippewa answered 3/6 at 18:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.