使用命令搭建好了k3s服务,也搭建了本地的registry,而后在k3s上建应用的时候,提示 html
Head https://172.17.0.1:5000/v2/nginx5-wtf/manifests/2.0: http: server gave HTTP response to HTTPS clientnginx
说的是k3s去拉镜像的时候用的https,可是镜像服务不支持https,只支持http;git
根据rancher的官方文档:https://docs.rancher.cn/docs/k3s/installation/private-registry/_index github
须要在/etc/rancher/k3s/registries.yaml 里配置成下面的样子。注意,用docker起rancher的时候,里面连vi都没有,用docker cp是最好的方法
docker
配置了以后,反复重启,不生效,最后查了一下,官方文档里是错的,ide
https://github.com/k3s-io/k3s/issues/1713 这里有个issuecode
须要改为 下面这样,其中 registry.local:5000,就是私有的镜像地址server
docker cp registries.yaml eafa3e42cb6e:/etc/rancher/k3s/registries.yamlhtm
mirrors: "registry.local:5000": endpoint: - "http://registry.local:5000"