containerd的安装和配置

containerd的安装和配置

配置yum源

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

containerd安装

yum install containerd  jq -y

jq是什么?

jq可以对json数据进行分片、过滤、映射和转换,和sed、awk、grep等命令一样,都可以让你轻松地把玩文本。它能轻松的把你拥有的数据转换成你期望的格式,而且需要写的程序通常也比你期望的更加简短。
jq是用C编写,没有运行时依赖,所以几乎可以运行在任何系统上。预编译的二进制文件可以直接在Linux、OS X和windows系统上运行,当然在linux和OS x系统你需要赋予其可执行权限;在Linux系统中也可以直接用yum安装。
download
在知道jq命令之前,我在linux系统中极少直接去命令处理json数据,除非只是简单的从中过滤某个字符串,那就用grep结合正则表达式来解决。所以,掌握了jq命令,则可以让Linux命令和shell脚本在处理json数据时变得得心应手。
jq简明教程
例子文件:
为了便于演示jq的功能,我们在文件json.txt中保存内容如下:
cat json.txt
[{“name”:“站长工具”,“url”:“http://tool.china.com”,“address”:{“city”:“广东”,“country”:“中国”},“arrayBrowser”:[{“name”:“Google”,“url”:“http://www.google.com”},{“name”:“Baidu”,“url”:“http:///www.baidu.com”}]},{“name”:“站长之家”,“url”:“http://tool.zzhome.com”,“address”:{“city”:“北京”,“country”:“中国”},“arrayBrowser”:[{“name”:“360”,“url”:“http://www.so.com”},{“name”:“bing”,“url”:“http://www.bing.com”}]}]

cat json.txt | jq ‘.’

初始化Containerd配置:

containerd config default > /etc/containerd/config.toml
systemctl enable --now containerd

替换containerd默认的sand_box 镜像,编辑/etc/containerd/config.toml文件:

sandbox_image = "k8s.gcr.io/pause:3.2"替换成registry.cn-hanzhou.aliyuncs.com/google-containers/pause-amd64:3.2

应用配置并重新运行containerd服务

systemctl daemon-reload
systemctl restart containerd
systemctl status containerd
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

河越柯衍

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值