当前位置:网站首页>Containerd容器运行时(2):yum安装与二进制安装,哪个更适合你?
Containerd容器运行时(2):yum安装与二进制安装,哪个更适合你?
2022-06-22 18:47:00 【51CTO】

一、前言
Containerd的安装,如果使用yum安装会简单很多,但安装的版本基本是固定的,在实际的业务场景不太适合。
二进制安装的方式,相对比较灵活。
二、yum方式安装
安装containerd会自动安装runc。
2.1 下载阿里云镜像源
2.2 搜索containerd软件
2.3 安装
2.4 启动containerd服务
2.5 查看服务信息
三、二进制方式安装
3.1 下载二进制包
Containerd有两种安装包:
- containerd-xxx:这种包用于单机测试没问题,不包含runC,需要提前安装。
- cri-containerd-cni-xxxx:包含runc和k8s里的所需要的相关文件。k8s集群里需要用到此包。虽然包含runC,但是依赖系统中的seccomp(安全计算模式,是一种限制容器调用系统资源的模式。)
$ wget https://github.com/containerd/containerd/releases/download/v1.6.5/cri-containerd-1.6.5-linux-amd64.tar.gz
$ tar zxvf cri-containerd-1.6.5-linux-amd64.tar.gz
$ ls
-l
drwxr-xr-x
4 root root
51
4月
26
07:52 etc
drwxr-xr-x
4 root root
35
4月
26
07:51 opt
drwxr-xr-x
3 root root
19
4月
26
07:50 usr
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
etc目录:主要为containerd服务管理配置文件及cni虚拟网卡配置文件;
opt目录:主要为gce环境中使用containerd配置文件及cni插件;
usr目录:主要为containerd运行时的二进制文件,包含runc;
containerd 的安装包中一共有五个文件,通过上面的命令它们被安装到了 /usr/local/bin 目录中:
- containerd:即容器的运行时,以 gRPC 协议的形式提供满足 OCI 标准的 API;
- containerd-release:containerd 项目的发行版发布工具;
- containerd-stress:containerd压力测试工具;
- containerd-shim:这是每一个容器的运行时载体,我们在 docker 宿主机上看到的 shim 也正是代表着一个个通过调用 containerd 启动的 docker 容器;
- ctr:它是一个简单的 CLI 接口,用作 containerd 本身的一些调试用途,投入生产使用时还是应该配合docker 或者 cri-containerd 部署;
3.2 拷贝二进制可执行文件到`$PATH`中
在解压安装包后,在解压后的usr/local/bin、目录下有相关的二进制可执行文件,将其复制到$PATH环境中。

3.3 创建配置文件
Containerd 的默认配置文件为/etc/containerd/config.toml
3.4 创建服务管理配置文件
拷贝服务管理配置文件到/usr/lib/systemd/system/目录
3.5 启动 containerd 服务
查看版本
3.6 安装runc(二进制)
由于二进制包中提供的runC默认需要系统中安装seccomp支持,需要单独安装,且不同版本runC对seccomp版本要求不一致,所以建议单独下载runC 二进制包进行安装,里面包含了seccomp模块支持。

【报错原因】 缺少依赖包libseccomp(2.4以上版本)
【解决办法】 安装libseccomp 2.5.1
$ wget http://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/libseccomp-2.5.1-1.el8.x86_64.rpm
$ rpm
-ivh libseccomp-2.5.1-1.el8.x86_64.rpm
$ rpm
-qa |
grep libseccomp
libseccomp-2.5.1-1.el8.x86_64
$ runc
-version
runc version
1.1.2
commit: v1.1.2-0-ga916309f
spec:
1.0.2-dev
go: go1.17.11
libseccomp:
2.5.1
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
四、推荐阅读(精品文章)
- Harbor高可用集群设计及部署(实操+视频),基于离线安装方式
- Harbor进阶:使用Harbor存储Helm chart
- Python实现Harbor私有镜像仓库的垃圾自动化
- Harbor jobservice组件异常问题处理
- Harbor高可用设计: 使用外部Redis缓存部分
- 阿里云镜像迁移到Harbor详细的操作步骤
- 如何将dockerhub上的镜像迁移到Harbor私有镜像仓库中?
- Harbor版本升级(1.10.7—>2.0.x)
- 担心Harbor数据丢失?谈谈Harbor的备份和恢复方法。
- Harbor版本升级(图文并茂)
- 多用户场景的Harbor,我是如何轻松管理的!
- Harbor高可用设计,使用外部数据库-详细到爆的操作步骤
- shell中获取Harbor中所有的镜像列表(超实用,建议收藏)
- harbor密码丢失,忘记Harbor密码?
- Helm部署Harbor,实现高可用的镜像仓库(超详细分享)~后附踩坑记录
- Harbor配置优化,配置文件深度解析!
- Prometheus监控Harbor实战(全网首发)
- k8s节点如何从Harbor中拉取镜像的?镜像拉取凭证的配置
- 企业内网如何搭建安全的Harbor服务?(超详细)
- Harbor一键部署——初学者如何快速了解它?

边栏推荐
- R语言基于h2o包构建二分类模型:使用h2o.glm构建正则化的逻辑回归模型、使用h2o.auc计算模型的AUC值
- 【深入理解TcaplusDB技术】TcaplusDB 表管理——新建表
- A text to show you the memory leak
- #夏日挑战赛# 【FFH】从零开始的鸿蒙机器学习之旅-NLP情感分析
- 【深入理解TcaplusDB技术】TcaplusDB运维
- [in depth understanding of tcapulusdb technology] getting started with MySQL driver
- [deeply understand tcapulusdb technology] how to initialize and launch tcapulusdb machine
- Fibonacci search (golden section)
- Pit of undefined reference
- 带超时的recv函数
猜你喜欢

图的存储结构(邻接矩阵)

What can the accelerated implementation of digital economy bring to SMEs?

Tree, forest and transformation of binary tree

【深入理解TcaplusDB技术】TcaplusDB 表管理——清理表

Definitions and terms of drawings

510000 prize pool invites you to join the war! The second Alibaba cloud ECS cloudbuild developer competition is coming
2019 年总结:31岁,不过是另一个开始

Redis中的Multi事务

【毕业季】走一步看一步?一个自动化er对大学四年的思考

树、森林及二叉树的相互转换
随机推荐
[deeply understand tcapulusdb technology] tcapulusdb model management
同花顺开户选哪家券商比较好?手机开户安全么?
University of Calgary | recommendation system based on Reinforcement Learning
【深入理解TcaplusDB技术】TcaplusDB运维
【深入理解TcaplusDB技术】TcaplusDB 表管理——新建表
归并排序(递归和迭代实现)
关键路径
I wrote a telnet command myself
Random talk about redis source code 122
[deeply understand tcapulusdb knowledge base] common problems in deploying tcapulusdb local
[in depth understanding of tcapulusdb technology] tcapulusdb adds a new business cluster cluster
Hash table (hash table)
How should programmers look up dates
请你描述下从浏览器上输入一个url到呈现出页面的整个过程。
【深入理解TcaplusDB技术】TcaplusDB常规单据
[deeply understand tcapulusdb technology] tcapulusdb process
Yarn notes
图的定义及术语
ROS从入门到精通(八) 常用传感器与消息数据
Pit of undefined reference