首页 > 其他分享 >Containerd-chep1-安装

Containerd-chep1-安装

时间:2024-05-06 17:12:50浏览次数:16  
标签:bin systemd amd64 Containerd runc local chep1 containerd 安装

本文致力于深入学习Contaienrd并整理。
参考官方文档

依赖与限制

独立使用containerd依赖于runcCNI plugins,可采用cri-containerd-cni-1.7.16-linux-amd64.tar.gz完整包安装,或拆分后各自安装。containerd是为基于glibcLinux发行版动态构建的,所以musl类的如Alpine则可能无法运行。

若作为Kubernetes的容器运行时使用,只需要使用containerd-<VERSION>-<OS>-<ARCH>.tar.gz类型的二进制包。从containerd 2.0起,cri-containerd-*命名的二进制包、档案已弃用。

安装

Containerd

下载安装

$ wget https://github.com/containerd/containerd/releases/download/v1.6.31/containerd-1.6.2-linux-amd64.tar.gz
$ tar Cxzf /usr/local containerd-1.6.2-linux-amd64.tar.gz
bin/
bin/containerd-shim-runc-v2
bin/containerd-shim
bin/ctr
bin/containerd-shim-runc-v1
bin/containerd
bin/containerd-stress

使用systemd管理

$ curl https://raw.githubusercontent.com/containerd/containerd/main/containerd.service | sudo tee -a /usr/local/lib/systemd/system/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://www.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 runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd

Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=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=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now containerd

参考官方文档

Delegate允许 containerd 及其运行时管理它创建的容器的 cgroup。如果不设置此选项,systemd 将尝试将进程移至其自己的 cgroup 中,从而导致 containerd 及其运行时无法正确考虑容器的资源使用情况。

关闭服务时,systemd默认会找服务的cgroup并杀死服务的每个进程,对于containerd而言会导致现有容器异常。设置KillModeprocess可确保systemd只杀死Containerd守护进程而不杀死子进程。

OOMScoreAdjust保障containerd因内存不足而被杀死的优先级。( 可设为 -1000(禁止被杀死) 到 1000(最先被杀死)之间的整数值。)

runc & cni

# install runc
$ wget https://github.com/opencontainers/runc/releases/download/v1.1.11/runc.amd64
$ install -m 755 runc.amd64 /usr/local/sbin/runc

# install cni
$ wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz
$ mkdir -p /opt/cni/bin
$ 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

标签:bin,systemd,amd64,Containerd,runc,local,chep1,containerd,安装
From: https://www.cnblogs.com/yulinor/p/18157716

相关文章

  • Docker安装mysql
    dockerpullmysql:5.7:从DockerHub上拉取MySQL5.7的镜像。dockerimages:列出所有已下载的镜像,确认MySQL5.7是否已经成功下载。mkdir-p/home/service/mysql/data:创建一个用于存放MySQL数据的目录。mkdir-p/home/service/mysql/conf:创建一个用于存放MySQL配置文件的目录......
  • docker安装
      uname-r查看系统版本号  yuminstall-yyum-utilsdevice-mapper-persistent-datalvm2   这个命令是用来在基于RPM的Linux发行版上安装一些必要的软件包。具体来说,它安装了以下软件包:yum-utils:这是一个命令行工具集合,提供了许多有用的功能,如清理缓存、......
  • Linux 和 Windows11双系统安装
    阅读目录1.下载Linux系统2.制作Linux系统启动盘3.电脑分盘4.安装Ubuntu系统5.安装完成后可能遇到的黑屏问题解决回到顶部1.下载Linux系统下载Linux系统的镜像文件,Linux系统有很多版本,Linux指的是系统内核,笔者下载的是Ubuntu系统,大家可以根据需要下载其他系统。Ubuntu......
  • Ubuntu18 安装NoMachine远程桌面(解决远程桌面延迟)
    #问题:Ubuntu18使用自带的共享桌面、VNC远程桌面延迟、降低分辨率也无效。#方案:最后找到安装NoMachine的远程桌面,解决远程卡顿问题根据自己操作系统选择NoMachineforLinux进行下载官网:https://downloads.nomachine.com/#出处:#https://www.cnblogs.com/liucx/#安装方......
  • AnsysEM安装教程(Linux)
    前期准备解压相关安装文件unzipCrack.zip将安装iso文件挂载到/mnt/AnsysEM目录下sudomkdir/mnt/AnsysEmsudomountAnsys.Electronics.2021.R1.Linux64.iso/mnt/AnsysEM/-oloop转到/mnt/AnsysEM/目录下,打开Readme文件查看安装步骤教程创建AnsysEM安装目录sudomkd......
  • pycharm安装dlib一直不成功解决方案
    直接在python的命令符窗口安装dlib会报ERROR:Couldnotbuildwheelsfordlib,whichisrequiredtoinstallpyproject.toml-basedprojects的错误,我试了很多网上的解决方案都没有成功,然后打算下载dlib的车轮文件,就成功了在下载文件之前要查看python版本所对应的dlib库 pip......
  • Ubuntu多版本CUDA安装与切换(转载)
    https://qiyuan-z.github.io/2022/01/04/Ubuntu%E5%A4%9A%E7%89%88%E6%9C%ACcuda%E5%AE%89%E8%A3%85%E4%B8%8E%E5qiyuan-z.github.io /2022/01/04/Ubuntu%E5%A4%9A%E7%89%88%E6%9C%ACcuda%E5%AE%89%E8%A3%85%E4%B8%8E%E5%88%87%E6%8D%A2/Ubuntu多版本CUDA安装与切换2022/1/4......
  • 如何把keil C51 和 keil MDK(ARM)安装在一起
    KeilC51与KeilMDK区别1:KeilC51,专门用于经典和扩展的8051mcu的开发工具,编译器是ANSICcompiler,包括C51Compiler,A51Assembler,LX51Linker2:KeilMDKMDK:MicrocontrollerDevelopmentKitKeilMDK-ARM专门用于开发基于ARM和Cortex-M的MCU,编译器是ARMCompiler,包括ARM......
  • 使用NSSM将.exe程序安装成windows服务
    1、下载NSSM:NSSM-theNon-SuckingServiceManager 2、cmd方式安装服务将下载的压缩包解压,找到nssm.exe,以管理员身份打开cmd,在cmd中定位到nssm.exe所在路径,执行nssminstall服务名: 按下enter键会自动弹出nssm的窗体: 在Application-ApplicationPath中选择你的可执行......
  • Docker-compose安装(Centos7)
    卸载原来的docker-composerm-rf/usr/local/bin/docker-composerm-rf/usr/bin/docker-compose下载docker-composecurl-L"https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-compos......