镇江网站关键字优化,上海企业建设网站,软考中级科目难度排行,12306网站开发过程简介 Kubernetes 从 v1.20 开始弃用 Docker#xff0c;并推荐用户切换到基于容器运行时接口#xff08;CRI#xff09;的容器引擎#xff0c;如 containerd、cri-o 等。 目前使用的环境中使用了 Kubernetes v1.22.3#xff0c;containerd 1.4.3#xff0c;containerd 在…简介 Kubernetes 从 v1.20 开始弃用 Docker并推荐用户切换到基于容器运行时接口CRI的容器引擎如 containerd、cri-o 等。 目前使用的环境中使用了 Kubernetes v1.22.3containerd 1.4.3containerd 在配置私服配置上与直接使用 docker 有一定区别。 今天简单聊一下如何配置私服默认使用 dockerhub 官方镜像 registry:v2 和 harbor 配置的私服为 http未做配置时 k8s 拉镜像时会以 https 协议访问。 假定已创建好的私服地址为 http://10.211.55.2:5000进行如下修改 编辑 worker 节点上 /etc/containerd/config.toml查找plugins.io.containerd.grpc.v1.cri.registry.mirrors配置 相关配置中调整为如下内容
[plugins.io.containerd.grpc.v1.cri.registry][plugins.io.containerd.grpc.v1.cri.registry.mirrors][plugins.io.containerd.grpc.v1.cri.registry.mirrors.docker.io]endpoint [https://registry.cn-hangzhou.aliyuncs.com][plugins.io.containerd.grpc.v1.cri.registry.mirrors.10.211.55.2:5000]endpoint [http://10.211.55.2:5000]参考 [plugins.io.containerd.grpc.v1.cri.registry.mirrors.10.211.55.2:5000] 行添加私服配置使用该配置可以直接配置相关 endpoint 为 http 地址。
重启 containerd使配置生效
systemctl restart containerd这时候使用 crictl pull 命令就可以获取 http 协议私服上的镜像了。
但是使用ctr命令还是不行原因: ctr does not read the /etc/containerd/config.toml config file, this config is used by cri, which means kubectl or crictl would use it. ctr命令拉取http格式的镜像地址方式
$. ctr image pull --plain-http image
# eg:
$. ctr i pull --plain-http k8s-harbor:10001/my-project/spring-boot-k8s:0.0.1-SNAPSHOT
k8s 使用 containerd 运行时配置 http 私服 - 简书