背景
kubespray crio 模式 registry 使用 docker registry, 目前 docker 是有ops限制,如果超出限制就会卡住限制流量。默认regisry用于查询镜像是否存在。kubespray 默认 crio 默认下载配置如下 /etc/containers/registries.conf.d/docker.io.conf
[[registry]]prefix = "docker.io"insecure = falseblocked = falselocation = "registry-1.docker.io"[[registry.mirror]]location = "hub-mirror.c.163.com"insecure = true[[registry.mirror]]location = "registry.docker-cn.com"insecure = true
解决方法
配置prefix replace
目前测试可以不使用默认 docker 仓库直接使用其他镜像仓库。减少去访问 registry-1.docker.io 查询和下载
- 网易仓库: hub-mirror.c.163.com
- 华中科大: docker.mirrors.ustc.edu.cn
- 百度:https://mirror.baidubce.com ```yaml [[registry]] prefix = “docker.io” insecure = true blocked = false location = “hub-mirror.c.163.com”
[[registry.mirror]] location = “hub-mirror.c.163.com” insecure = true
[[registry.mirror]] location = “docker.mirrors.ustc.edu.cn” insecure = true
<a name="GR4Vk"></a>### 配置下载并发数目控制并发过多导致网络/私有镜像仓库负担
[engine] image_parallel_copies=30 # 控制并发数目30
<a name="M3BRH"></a>### 代理下载crio 支持代理下载 如果下载外网的资源,gcr.io, query.io 还可以通过代理下载。<br />/etc/systemd/system/crio.service.d/http-proxy.conf```bashEnvironment="HTTP_PROXY=http://you_proxy_ip:port" "HTTPS_PROXY=http://you_proxy_ip:port"
