Kubernetes/Containerd/Docs/网络源安装Containerd.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

1.7 KiB

本文作者:丁辉

Github安装文档

Containerd软件包 Runc软件包 Cni插件包

网络源安装Containerd

  1. 设置存储库

    阿里源配置文件

    yum install -y yum-utils
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    

    国内

    yum install -y yum-utils
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
  2. 安装

    yum install -y containerd.io
    
  3. 备份配置文件

    mv /etc/containerd/config.toml /etc/containerd/config.toml.bak
    containerd config default > /etc/containerd/config.toml
    
  4. 修改驱动和镜像地址

    vi /etc/containerd/config.toml
    

    内容如下

    [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
      ...
      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
        SystemdCgroup = true #修改这里
    
    [plugins."io.containerd.grpc.v1.cri"]
      sandbox_image = "registry.aliyuncs.com/google_containers/pause:3.9"
    
  5. 配置 crictl 配置文件

    curl -so /etc/crictl.yaml https://gitee.com/offends/Kubernetes/raw/main/Containerd/Files/crictl.yaml
    
  6. 启动

    systemctl enable containerd
    systemctl start containerd
    systemctl status containerd