In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly talks about "what is the structure of Containerd". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the structure of Containerd"?
First acquaintance of ContainerdContainerd and Docker
In his previous work, containerd had always been the presence of Schrodinger, known only by his name but had little chance to use his talents, and it was not until some time ago when K8s officially announced that it would abandon Docker that it brought this guy back to public view. On a technical level, I have also discussed the relationships between container runtimes such as CRI, containerd, and Docker in previous articles. Interested friends can take a look at these articles:
Understand the container runtime
K8s, CRI and container
Now I'm just curious about why CNCF is doing this on a non-technical level, so let's gossip about the past lives of Containerd and Docker and their love and hatred.
A few years ago, Docker rose strongly in the field of container technology, and giants like Google and RedHat had a great sense of crisis, so they wanted to work with Docker to develop and promote an open source container runtime as the core dependence of Docker technology. However, Goose Docker said coldly, "I won't do it!" The giants were upset to hear this feedback, so they used some means to make Docker donate libcontainer to the open source community, which is now runc, a low level container runtime. In addition, the giants set up CNCF to fight against the dominance of Docker, and the idea of CNCF was clear: if you can't beat Docker in the container field, then do the construction of the upper layer of the container-container choreography, and K8s was born. Although Docker also tried to use Swarm against K8s, it failed in the end.
Since then, K8s has gradually become the standard in the cloud native field, and its ecology is getting bigger and better. In order to integrate into the ecology, Docker has opened up the core dependence of Docker on containerd. In addition, in order to dock the next layer of containers, K8s also has a runtime interface, that is, CRI (Container Runtime Interface), runc, containerd and other runtimes, to support this interface. Because there was really no high level runtime,oci-o at that time, although it supported the CRI interface, its function was too weak; containerd was not yet mature, and its positioning at that time was embedded in the system, not for end users; rkt had its own system (and later the project failed). Only temporarily in order to adapt to the Docker to get a shim, CRI into Docker API. K8s and Docker have entered a cooling-off period, and both sides are optimizing themselves without interfering with each other. However, the dark tide is still surging under the calm, and the CNCF community has been constantly improving containerd, and its positioning has also changed from the original system embedded components to today's "industry standard container runtime" and provided to end users. It wasn't until last year that K8s announced that it would abandon Docker and use Containerd instead. In fact, in addition to these commercial factors, on the other hand, K8s has provided a standard interface to interface with the underlying container operation, and you no longer want to maintain an adaptation layer similar to Docker shim to cater to different runtimes, and there is nothing wrong with doing so (in fact, I think you have grown up and threw the pot to the bottom).
Containerd architecture
Well, now that we've finished eating melons, let's go back to the technical level and take a look at what the architecture of Containerd looks like. First, let's take a look at the functions of containerd:
The official website claims to support OCI's mirroring standard.
Container runtime for OCI
Push and pull of image
Container runtime lifecycle management
Multi-tenant mirrored storage
Network management and network namespace management, support container network to join existing namespace
I'll just be a good guy. I have all the core functions of Docker. And take a look at the architecture diagram.
Containerd is designed as a large plug-in system, and each dotted frame in the figure actually corresponds to a plug-in.
From the bottom up, the underlying support for arm and x86 architecture, support for Linux and windows systems.
The middle containerd contains three layers: Backend, core, and API. Runtime plugin in Backend provides specific operations of container runtime, and containerd also provides a series of containerd-shim in order to support different container runtimes, such as shim mentioned in the previous article K8s & kata container principle practice. Core is the core part, providing services with various functions, among which Content service is commonly used, which provides access to addressable content in the image, where all immutable content is stored; Images Service provides image-related operations; and Snapshot Plugin: it is used to manage file system snapshots of container images. Each layer in the mirror is extracted into a file system snapshot, similar to graphdriver in Docker. Further up is the API layer, which connects with the client through GRPC, which provides Prometheus with API for monitoring. Here is a good comment!
The top layer is a variety of clients, including K8s kubelet,containerd own command line ctr and so on.
Simplify the image above:
After simplification, Containerd is divided into three parts: Storage manages the storage of image files; Metadata manages the metadata of images and containers; and Task triggers the runtime. Provide API and Metrics interfaces in GRPC mode.
At this point, I believe you have a deeper understanding of "what is the structure of Containerd". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Get-ClusterNodeRemove-Clusternode-name {Node computer name}
© 2024 shulou.com SLNews company. All rights reserved.