cby-chen / Kubernetes

kubernetes (k8s) 二进制高可用安装,Binary installation of kubernetes (k8s) --- 开源不易,帮忙点个star,谢谢了🌹

Home Page:https://www.oiox.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2.1.4创建Containerd的配置文件-更换国内源

tianh opened this issue · comments

commented

参考链接: https://blog.51cto.com/lajifeiwomoshu/5428345

摘录:
以下所有操作都是containerd 1.6.x版本做的操作。

1、指定配置文件目录

[plugins."io.containerd.grpc.v1.cri".registry]
      config_path = "/etc/containerd/certs.d/"

2、根据镜像仓库创建文件

cd /etc/containerd/certs.d/

3、配置加速

mkdir -p /etc/containerd/certs.d/docker.io
cat >/etc/containerd/certs.d/docker.io/hosts.toml <<EOF
server = "https://docker.io"
[host."https://g0v522ip.mirror.aliyuncs.com"]
  capabilities = ["pull","resolve"]
[host."https://docker.mirrors.ustc.edu.cn"]
  capabilities = ["pull","resolve"]
[host."https://registry-1.docker.io"]
  capabilities = ["pull","resolve","push"]
EOF

注意的是:

  • 如果hosts.toml文件中的capabilities中不加resolve的话,无法加速镜像
  • 要配保底的加速站点,否则可能会导致下载失败

©著作权归作者所有:来自51CTO博客作者lajifeiwomoshu的原创作品,请联系作者获取转载授权,否则将追究法律责任
containerd的那些事
https://blog.51cto.com/lajifeiwomoshu/5428345

大哥我想问一下, 你照着这个教程安装能成功吗, 哪些流程中除了 K8S 命令相关的我没看明白别的都懂, 为啥到装 node 节点里面的 kubelet 哪里执行 kubectl get nodes 就会报 No resources found