containerd安装
- 参考资料
- 前置准备
- Installing containerd
- Installing runc
- Installing CNI plugins
containerd is available as a daemon for Linux and Windows. It manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond.
参考资料
k8s官方教程
containerd
安装教程
前置准备
root@ubuntu0:~/kubernetes/deploy# tree
├── cni-plugins-linux-arm64-v1.5.1.tgz //cni网络管理工具包
├── containerd-1.7.22-linux-arm64.tar.gz //容器管理工具
├── containerd.service //containerd启用文件
└── runc.arm64 //底层容器管理工具
以上4个文件均可点击去下载
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
Installing containerd
点击去下载
- 解压containerd-1.6.2-linux-amd64.tar.gz
# containerd-1.6.2-linux-amd64.tar.gz这是上面下载的
$ tar Cxzvf /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
- 下载containerd.service文件
点击去下载
mkdir -p /usr/local/lib/systemd/system/
# 将下载的containerd.service文件创建到:/usr/local/lib/systemd/system/containerd.service
- 启动containerd
systemctl daemon-reload
systemctl enable --now containerd # 开机自启并现在也启动
Installing runc
- 下载runc文件
点击去下载
上面的runc文件,大家根据实际部署服务器的架构支持来定。
其他比如说还有:
libseccomp-2.5.5.tar.gz
libseccomp-2.5.5.tar.gz.asc
runc.386
runc.386.asc
runc.amd64
runc.amd64.asc
runc.arm64
runc.arm64.asc
runc.armel
runc.armel.asc
- 安装runc
#runc.amd64是上面下载的具体文件
install -m 755 runc.amd64 /usr/local/sbin/runc
Installing CNI plugins
-
下载CNI
点击去下载 -
安装CNI
#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
至此以上就安装完成containerd了。