简体   繁体   中英

What is --pod-infra-container-image meant for?

What is purpose of pod-infra-container-image in kubernetes?

Official documentation says only:

The image whose network/ipc namespaces containers in each pod will use. (default "gcr.io/google_containers/pause-amd64:3.0")

but I don't understand exactly what it does and how it works in detail.

The pause container, which image the --pod-infra-container flag selects, is used so that multiple containers can be launched in a pod, while sharing resources. It mostly does nothing, and unless you have a very good reason to replace it with something custom, you shouldn't. It mostly invokes the pause system call (hence its name) but it also performs the important function of having PID 1 and making sure no zombie processes are kept around.

An extremely complete article on the subject can be found here , from where I also shamelessly stole the following picture which illustrates where the pause container lives:

在此输入图像描述

The pause container is built from https://github.com/kubernetes/kubernetes/tree/master/build/pause . The process itself does nothing so you can replace it with another container of your choice that equally does nothing (with the --pod-infra-container-image parameter of kubelet ).

This container is started as a part of each and every pod. Kubernetes is using this well-known, never falling container to setup the network namespace for the pod and make sure the namespace is never empty (all the other containers in the pod might fail). But again, the container process itself does nothing, it's just a placeholder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM