The story of Kubernetes and Docker

In version 1.5 at the end of 2016, Kubernetes introduced a new interface standard: CRI, Container Runtime Interface.

CRI uses ProtoBuffer and gPRC to specify how kubelet calls the container runtime to manage containers and images, but this is a brand new interface that is completely incompatible with previous Docker calls.

 Kubernetes can only provide a "compromise" solution at the same time, adding an "adapter" between kubelet and Docker to convert Docker's interface into an interface that conforms to the CRI standard.

And Docker split the original single-architecture Docker Engine into multiple modules, and the Docker daemon part was donated to CNCF to form containerd.

As a managed project of CNCF, containerd must comply with CRI standards. However, due to its own reasons, Docker only calls containerd in Docker Engine, and the external interface remains unchanged, which means it is not yet compatible with CRI.

 There are two call chains in Kubernetes:

  • The first is to use the CRI interface to call dockershim, then dockershim calls Docker, and Docker uses containerd to operate the container.
  • The second is to use the CRI interface to directly call containerd to operate the container.

Since containerd is used to manage containers, the final effect of the two call chains is exactly the same, but the second method saves the two links of dockershim and Docker Engine, which is more concise and clear, with less loss and better performance Improve some.

Therefore, "abandoning Docker" will not have much impact on Kubernetes and Docker, because both of them have already changed the lower layer to open source containerd, and the original Docker image and container will still run normally , the only change is that Kubernetes bypasses Docker and directly calls containerd inside Docker.

Docker is a complete software product line, not just containerd, it also includes mirror building, distribution, testing and many other services, and even built-in Kubernetes in Docker Desktop.

This article is a study note for Day 10 in July. The content comes from Geek Time "Kubernetes Introductory Practical Course". This course is recommended.

Guess you like

Origin blog.csdn.net/key_3_feng/article/details/131649030