Installing containerd
Install containerd on the management and compute nodes.
Procedure
- Clone the containerd source package.
git clone https://github.com/containerd/containerd -b release/1.4
- Initialize the directory module.
cd containerd go mod init github.com/containerd/containerd

- Add missing modules and delete unnecessary modules.
go mod tidy
- Download dependencies to the project.
go mod vendor
- Compile the source code.
make

- Install containerd.
make install

- Configure systemd.
mkdir -p /usr/local/lib/systemd/system/ cp containerd.service /usr/local/lib/systemd/system/containerd.service systemctl daemon-reload systemctl enable --now containerd

- Create a default containerd configuration file and configure cgroup.
Modify the sandbox_image parameter. Otherwise, you may fail to pull images.
- Create a default containerd configuration file.
mkdir -p /etc/containerd containerd config default > /etc/containerd/config.toml
- Set the cgroup and sandbox_image parameters.
- Open the /etc/containerd/config.toml file.
vi /etc/containerd/config.toml
- Press i to enter the insert mode. In the /etc/containerd/config.toml file, change sandbox_image under the [plugins."io.containerd.grpc.v1.cri"] field to the following information:
sandbox_image="registry.aliyuncs.com/google_containers/pause:3.2"
- Under the [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] field, add the following information to complete the cgroup configuration:
SystemdCgroup = true
Modification result:

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Restart containerd to make the new configuration take effect.
sudo systemctl restart containerd
- Open the /etc/containerd/config.toml file.
- Create a default containerd configuration file.
Parent topic: Deploying the Kubernetes Cluster