kubelet analysis process creation container

kubelet initiate the process of creating a command to actually create and launch container vessel

image.png


Content Analysis Process

  1. kubelet initiated by gRPC calling dockershim create the container, CRI namely container Runtime Interface (container runtime interface), the current dockershim code embedded in kubele, the container is so accepted create kubelet process.

  2. dockershim converted into a command to create a container docker daemon recognizable command, then sent to the docker daemon created container.

  3. docker daemon version 1.12 after the command will create containers distributed to another process: comtainerd.

  4. After containerd receive command creates a container to create another process: containerd-shim process, executed by the process to create a specific command, do containerd process. The presence of the parent process.

  5. When you create a container needs to namespace isolation container to start and create the required resources, cgroup restrictions containers can use the resources of the size of the operation, these things how to do that has been to see the public specification OCI (open container initivtive open container standards), it's a reference implementation is called runc. So containerd - shim At this stage we need to call runc command to start the container.

  6. It will exit after the container runc start, containerd-shim will become the parent container process, the status of the collection container process, reported to contanierd, and container species pid is the process of taking over the container exit 1 Chinese child processes to clean up, ensure that no zombie process.


This one has two terms confusing concepts

CRI: Interface container runtime interface container runtime

Its main role:

1, an interface for container operations, including the construction of a container, such as start and stop

2, for the operation of the mirror, got me to delete mirroring

3, for podsandbox (container sandbox environment)


OCI: open container standard open container initiative

The main role of container production

  1. Mirroring the contents of the container, i.e. imagespec

  2. Receiving an instruction which requires the container, i.e. runtimespec


Guess you like

Origin blog.51cto.com/12182612/2436484