【Containerd】让Kubernetes性能再次提升

网友投稿 752 2022-11-03

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

【Containerd】让Kubernetes性能再次提升

自从kubernetes宣布不再使用Docker,很多人包括从事云计算运维行业的人都产生错误的理解,之所以理解错误是因为本身对于Docker技术只停留在表面,深层次对于Docker的理解不到位导致的,今天我们一起来看看这个问题。

1理解Docker

Docker由 Docker-client ,Dockerd,Containerd,Docker-shim,Runc组成;所以Containerd是Docker的基础组件之一。

2为什么要选择Containerd

从Kubernetes角度来说,Docker作为Kubernetes容器运行时,调用关系是:

从Kubernetes角度来说,Containerd作为Kubernetes容器运行时,调用关系是:

综上所述,Containerd 调用链更短,组件更少,更稳定,占用节点资源更少调用链,所以Kubernetes丢弃Docker进而选择Containerd。

3Dockerd

Dockerd是管理容器的持久进程;Docker 为守护进程和客户端使用不同的二进制文件;要运行守护程序,键入Dockerd。

4Containerd

Dockerd实际真实调用的还是Containerd的api接口,Containerd是Dockerd和Runc之间的一个中间交流组件。

5Docker-shim

Docker-shim是一个真实运行的容器的真实垫片载体,每启动一个容器都会起一个新的Docker-shim的一个进程。

6Runc

Runc是一个命令行工具端,他根据OCI(开放容器组织)的标准来创建和运行容器。

第一步:Installing containerd链接地址:https://github.com/containerd/containerd/blob/main/docs/getting-started.md[root@master ~]# wget https://github.com/containerd/containerd/releases/download/v1.6.8/containerd-1.6.8-linux-amd64.tar.gz[root@master ~]# tar xf containerd-1.6.8-linux-amd64.tar.gz[root@master ~]# cp bin/* usr/local/bin创建systemctl管理服务启动文件/usr/local/lib/systemd/system/containerd.service/etc/systemd/system/multi-user.target.wants/containerd.service[root@master ~]# cat containerd.service# Copyright The containerd Authors.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.[Unit]Description=containerd container runtimeDocumentation=https://containerd.ioAfter=network.target local-fs.target[Service]#uncomment to enable the experimental sbservice (sandboxed) version of containerd/cri integration#Environment="ENABLE_CRI_SANDBOXES=sandboxed"ExecStartPre=-/sbin/modprobe overlayExecStart=/usr/local/bin/containerdType=notifyDelegate=yesKillMode=processRestart=alwaysRestartSec=5# Having non-zero Limit*s causes performance problems due to accounting overhead# in the kernel. We recommend using cgroups to do container-local accounting.LimitNPROC=infinityLimitCORE=infinityLimitNOFILE=infinity# Comment TasksMax if your systemd version does not supports it.# Only systemd 226 and above support this version.TasksMax=infinityOOMScoreAdjust=-999[Install]WantedBy=multi-user.target[root@master ~]# systemctl daemon-reload[root@master ~]# systemctl start containerd第二步:Installing runc链接地址:https://github.com/opencontainers/runc/releases[root@master ~]# wget https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64[root@master ~]# install -m 755 runc.amd64 usr/local/sbin/runc第三步:Installing CNI plugins链接地址:https://github.com/containernetworking/plugins/releases[root@master ~]# wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz[root@master ~]# mkdir -p /opt/cni/bin[root@master ~]# tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.1.1.tgz././macvlan./static./vlan./portmap./host-local./vrf./bridge./tuning./firewall./host-device./sbr./loopback./dhcp./ptp./ipvlan./bandwidth

上一篇:软件测试培训之测试中的团队建设
下一篇:软件测试培训之测试计划与测试方案
相关文章

 发表评论

暂时没有评论,来抢沙发吧~