首页 > 其他分享 >containerd安装

containerd安装

时间:2022-09-20 15:00:13浏览次数:72  
标签:bin 安装 containerd sudo usr cri config

下载安装包

wget https://github.com/containerd/containerd/releases/download/v1.6.8/cri-containerd-1.6.8-linux-amd64.tar.gz
wget https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64

cri-containerd 有包含 runc 二进制文件,但是编译的时候没有包含 libseccomp 依赖。

两个方法解决:

  1. 下载包含 libseccomp 依赖的 runc 二进制文件(本文章采用该方式)
  2. 宿主机安装依赖。例如用于 CentOS 的 libseccomp-devel,或用于 Ubuntu 的 libseccomp-dev

解压文件

mkdir cri-containerd
tar xf cri-containerd-1.6.8-linux-amd64.tar.gz -C cri-containerd
sudo cp cri-containerd/usr/local/bin/* /usr/local/bin
sudo cp runc.amd64 /usr/local/bin/runc && chmod +x /usr/local/bin/runc

生成contaienrd配置文件

sudo mkdir -p /app/containerd/{config,data}
containerd config default | sudo tee /app/containerd/config/config.toml

修改containerd默认配置

$ diff /app/containerd/config/config.toml /tmp/config.toml
6c6
< root = "/app/containerd/data"
---
> root = "/var/lib/containerd"
61c61
<     sandbox_image = "registry.aliyuncs.com/k8sxio/pause:3.6"
---
>     sandbox_image = "k8s.gcr.io/pause:3.6"
125c125
<             SystemdCgroup = true
---
>             SystemdCgroup = false
154,155d153
<         [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
<           endpoint = ["https://docker.mirrors.ustc.edu.cn", "https://registry.docker-cn.com"]

crictl连接containerd配置文件

$ cat <<-EOF | sudo tee /etc/crictl.yaml > /dev/null
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
EOF

配置systemd服务

sudo cp cri-containerd/etc/systemd/system/containerd.service /usr/lib/systemd/system
sudo sed -ri 's@(ExecStart)=.*@\1=/usr/local/bin/containerd --config /app/containerd/config/config.toml@g' /usr/lib/systemd/system/containerd.service

启动containerd

sudo systemctl daemon-reload
sudo systemctl start containerd && sudo systemctl enable containerd

验证服务

$ sudo /usr/local/bin/ctr version
Client:
  Version:  v1.6.8
  Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
  Go version: go1.17.13

Server:
  Version:  v1.6.8
  Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
  UUID: 88acbbf1-2a1e-435c-8056-4d0d4734e341

$ sudo /usr/local/bin/crictl pull registry.aliyuncs.com/k8sxio/pause:3.6
Image is up to date for sha256:6270bb605e12e581514ada5fd5b3216f727db55dc87d5889c790e4c760683fee

标签:bin,安装,containerd,sudo,usr,cri,config
From: https://www.cnblogs.com/jiaxzeng/p/16708491.html

相关文章

  • paddleocr安装与图片识别快速开始
    本文首发我的个人博客:paddleocr安装教程快速开始1.安装Python环境wgethttps://mirrors.huaweicloud.com/python/3.8.5/Python-3.8.5.tgz下载后,解压,编译,安装,即可。......
  • docker离线安装
    //下载静态包//https://download.docker.com/linux/static/stable///解压tgz包到docker文件夹tar-xzvfdocker.tgz//将docker文件复制到/usr/bin下sudocpdocker/*/us......
  • Docker安装部署Mysql8(以作数据持久化)
    1.创建容器并进行持久化处理#拉取镜像dockerpullmysql:8.0.20#启动镜像,用于拷贝配置文件到宿主机dockerrun-p3306:3306--namemysql-eMYSQL_ROOT_PASSWORD=12......
  • 安装配置docker&maven环境
     原文视频:(https://blog.sechelper.com/20220919/code-review/docker-maven-install-guid/)Docker是什么Docker是一个开源的应用容器引擎。Docker可以让开发者打包他们......
  • ES介绍-安装-插件-ElasticSearch-head-ElasticSearch-安装Kibana
    ES介绍 #大规模数据如何存储和检索---》elasticsearch#Elasticsearch是一个基于Lucene的分布式搜索和分析引擎,分布式全文检索引擎,java开发,遵循apache开源协议使......
  • JDK安装与卸载
    #卸载JDK1.删除JAVA的安装目录2.删除JAVA_HOME3.删除path下关于java的目录4.java-version #安装JDK1.百度搜索JDK8,找到下载地址2.同意协议3.下载电脑的......
  • 虚拟机Vmware安装及运行
    Vmware官方下载地址:https://www.vmware.com/cn/products/workstation-pro/workstation-pro-evaluation.htmlVmware许可证:ZF3R0-FHED2-M80TY-8QYGC-NPKYF......
  • Linux环境安装JDK8
    1、卸载系统中自带的openJDK1.1使用java-version命令查询系统是否有自带jdk 1.2使用rpm-qa|grepjava,命令查询java套件,删除包含openJDK的包rpm-e--nodepsjav......
  • Linux安装Nginx
    linux版本:CentOS6.0+1、下载nginxrpm包命令wgethttp://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm2、安装nginxrp......
  • hbase安装
    配置环境变量vim/etc/profile.d/my_env.sh#HBASE_HOMEexportHBASE_HOME=/opt/module/hbase-2.4.14exportPATH=$PATH:$HBASE_HOME/binsource/etc/profile......