28

在我的 IBM Cloud Private 中,我看到了几个暂停容器。

谁能解释这些的目的?通常,我可以在正在运行的容器中访问 bash shell,但不能访问暂停的容器。

# 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
4

4 回答 4

43

“暂停”容器是一个容器,其中包含 pod 的网络命名空间。Kubernetes 创建暂停容器以获取相应 pod 的 IP 地址,并为加入该 pod 的所有其他容器设置网络命名空间。

您可以访问以下链接了解详细信息。

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

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

于 2018-02-07T02:13:53.290 回答
7

Pause是一个秘密容器,运行在 Kubernetes 的每个 pod 上。这个容器的主要工作是保持命名空间打开,以防 pod 上的所有其他容器都死掉。

于 2019-11-27T09:44:59.103 回答
5

是的,pause 容器是每个 pod 的一部分,负责创建共享网络,为该 pod 内的所有业务容器分配 pod 内的 ip 地址,pause 容器也共享整个 pod 的卷。如果暂停容器已死,kubernetes 认为该 pod 已死并杀死它并重新安排一个新的。

于 2018-02-08T08:05:45.173 回答
3

如果你 docker stop 暂停容器,你会发现 Pod 将有一个新的内部 IP,而 Pod 的重启计数没有任何变化。但是,如果您 docker stop 容器的 Pod,您会发现 Pod 状态为 Completed,然后如果您将 docker start 相同,您会发现 Pod 再次运行,Pod 的重新启动计数增加 1,并且没有变化知识产权。

于 2019-10-11T12:00:20.397 回答