当前位置:网站首页>Containerd series - what is containerd?
Containerd series - what is containerd?
2022-07-05 03:55:00 【PinkGranite】
This article will be about containerd To introduce
Reference resources :
Introduction to containerd - Phil Estes, IBM $ Derek McGowan, Docker
Catalog
1. What is? containerd?
- containerd It's a “container runtime”: What is? container runtime?runtime It refers to the container runtime , in other words containerd Given container runtime support . But it should be noted that :containerd It is not a real runtime , It has the ability of runtime to some extent ( Mainly due to its downstream runtime Support ). As can be seen from the above figure ,containerd It undertakes the functions of higher-level container management ( for example Docker,K8S), The lower layer is equipped with a lower level runtime( for example runc wait —— About runc You can refer to Series articles ).
- containerd Is a resource manager (resource manager):containerd You can manage the lifecycle of containers , Involving the creation of containers 、 Delete and so on ; Images can be managed ; You can manage file system snapshots ; You can manage the meta information and dependent information of the container .
- containerd It is a tightly coupled project (tightly scoped):containerd Ben's body size is very much , Many functions are built on the extension system .
2. containerd The history of
- Original containerd It's just Docker A companion application running , As the connection docker And the ground floor runc Middleware
- With continuous development ,containerd Gradually from a container supervisor( That is, it only has basic container detection and execution functions ) Degenerate into a fully functional container runtime( The whole process )
- although containerd The birth and docker Interwovenness , however containerd Designed a new container and image management interface
- CRI As a plug-in independent of container process, it has been integrated into containerd in , send containerd Be in line with CRI Standard container runtime
3. Why use containerd?
- K8S Users :K8S At present, it is the most widely used container management project in industrial applications , and K8S Yes containerd With considerable and good support ,containerd stay K8S Is also the most mature .
- For developers : If you are a developer , Use docker kit Do image development , Then you have used it in real time containerd,docker Itself is also right containerd Supported
- Edge development : If you are a developer of edge applications ,containerd Due to the small volume , The advantages of high efficiency are widely used in edge virtualization scenes , for example K3S( It can be understood as K8S A smaller version of , Applicable to edge scenes , Please take a look at the exam here )
- For service providers :containerd It can well support external service access , Reference resources faasd,IBM Cloud Function etc.
- Program stability :containerd Of daemon Even if it collapses, it will not affect the running containers and programs
- Efficient use of resources :containerd daemon The memory space and resources required are very small ( So it also applies to edge scenes )
- File system resource management :contianerd Provides a garbage collection mechanism , For redundant and unused file system resources ,containerd It can be recycled automatically , Reduce the invalid occupation of file system resources
4. containerd Architecture (containerd1.4.x)
4.1 The overall structure
- overall contianerd from Client、API、Core、Backend( Or you could say API、Core、Backend It's a whole , by containerd core)、Shim It consists of five parts , Build on the system and image warehouse
- Control information and data from Client Flow right , Know the container runtime shim
4.2 Client
- Client It's user use containerd Direct interaction objects in the process , about containerd For beginners ,Client It is the module that should be introduced first , It provides rich functions and flexibility for exploring new features and extensions
- Container Management The sub modules are Client Module with container runtimes Sub modules for interaction : This sub module can provide OCI specification establish ,snapshot Creation and other functions
- Image Distribution yes Client The sub module of image management in , Provides image import , export , Pull , Push and other functions
- containerd The project tries to keep core Part of the concise refinement , therefore Client Part also undertakes more functions and requirements accordingly
- Client The module can be self configured —— It means Client Very flexible
4.3 containerd core(API、Core、Backend)
- This section defines containerd The types of data structures used in and API Interface
- Why? containerd To provide so many interfaces ( whether containerd Too dependent on the use of interfaces )?—— In fact, these interfaces and data types are set for containerd core Become an intermediate station for data information forwarding , Based on the definition of data structure type ,core It can track the data passing through this part for better use
- Data from core Part of it flows through and is core Track and record , That means core part ( And some of them plugins) No need to store data —— It's also convenient core Medium GC Modules work , Reduce the risk of challenges such as data inconsistency
- Yes Plugin The support of containerd core An important feature of , This makes containerd It has good scalability and flexibility
- plugin Can be like core Send a message ,core You can also ask plugin Send a message ,backend It is also pluggable (
plugable
)—— for example core Medium Snapshots That is to say plugin The way to achieve - Each plug-in can be self configured , These configurations will also be included containerd In the main configuration of
- If we have a service application , So it can also be done through grpc Way and core Interact —— for example core Medium CRI The module itself exists as a service , adopt grpc Way and core Interact
- By default Client Will pass proxy Service opportunities grpc And core Interact
4.4 Shim
- containerd core Medium Runtime The sub module can start a new runtime shim, It can pass oci spec And other control information to Shim
- Shims Is really owned container processes The role of control ,Shim As container The direct parent process of exists (
I don't know whether it's right here
) - containerd core Through a lightweight grpc protocal ttrpc And Shim Interact ; If you restart containerd, that containerd Need to reconnect with shim Establish a connection to pass instructions and data
- There are already many different Shim Realization , One of the most widely used is runc
- runhcs Is running on the windows Upper Shim
边栏推荐
- Kubernetes - identity and authority authentication
- C # use awaiter
- 面试汇总:这是一份全面&详细的Android面试指南
- EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
- Redis6-01nosql database
- [wp]bmzclub几道题的writeup
- 官宣!第三届云原生编程挑战赛正式启动!
- Google Chrome CSS will not update unless the cache is cleared - Google Chrome CSS doesn't update unless clear cache
- 灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?
- ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
猜你喜欢
Multimedia query
UI automation test farewell to manual download of browser driver
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?
IronXL for .NET 2022.6
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
grandMA2 onPC 3.1.2.5的DMX参数摸索
[groovy] string (string type variable definition | character type variable definition)
[an Xun cup 2019] not file upload
This article takes you to understand the relationship between the past and present of Bi and the digital transformation of enterprises
随机推荐
Kubernetes - identity and authority authentication
[wp]bmzclub几道题的writeup
输入的查询SQL语句,是如何执行的?
glibc strlen 实现方式分析
优先使用对象组合,而不是类继承
UI automation test farewell to manual download of browser driver
How about programmers' eyesight| Daily anecdotes
Why is there a reincarnation of 60 years instead of 120 years in the tiangan dizhi chronology
【做题打卡】集成每日5题分享(第三期)
Redis6-01nosql database
汇编-入门
Multimedia query
线上故障突突突?如何紧急诊断、排查与恢复
In MySQL Association query, the foreign key is null. What if the data cannot be found?
Delphi free memory
Difference between MotionEvent. getRawX and MotionEvent. getX
C # use awaiter
Clickhouse物化视图
error Couldn‘t find a package.json file in “你的路径“
线程基础知识