RKE2 mirror registry not working

问题描述:
RKE2的镜像仓库 registry.cn-hangzhou.aliyuncs.com 失效了

重现步骤:

root@ubuntu:~# mkdir -p /etc/rancher/rke2/
root@ubuntu:~# cat >/etc/rancher/rke2/config.yaml <<EOL 
token: 123456
system-default-registry: registry.cn-hangzhou.aliyuncs.com
EOL

root@ubuntu:~# curl -sfL https://rancher-mirror.rancher.cn/rke2/install.sh |  INSTALL_RKE2_MIRROR=cn sh -
root@ubuntu:~# systemctl start rke2-server
日志
root@ubuntu:~# systemctl start rke2-server
Job for rke2-server.service failed because the control process exited with error code.
See "systemctl status rke2-server.service" and "journalctl -xeu rke2-server.service" for details.

ubuntu@ubuntu:~$ sudo journalctl -xeu rke2-server -f
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=warning msg="Failed to load runtime image index.docker.io/rancher/rke2-runtime:v1.32.6-rke2r1 from tarball: no local image available for index.docker.io/rancher/rke2-runtime:v1.32.6-rke2r1: directory /var/lib/rancher/rke2/agent/images does not exist: image not found"
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=info msg="Waiting for cri connection: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial unix /run/k3s/containerd/containerd.sock: connect: no such file or directory\""
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=warning msg="Failed to load runtime image registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime:v1.32.6-rke2r1 from tarball: no local image available for registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime:v1.32.6-rke2r1: directory /var/lib/rancher/rke2/agent/images does not exist: image not found"
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=info msg="Pulling runtime image registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime:v1.32.6-rke2r1"
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=warning msg="Failed to get image from endpoint: GET https://registry.cn-hangzhou.aliyuncs.com/v2/rancher/rke2-runtime/manifests/v1.32.6-rke2r1: MANIFEST_UNKNOWN: manifest unknown; map[Tag:v1.32.6-rke2r1]"
Jul 02 23:53:13 ubuntu rke2[1139]: time="2025-07-02T23:53:13+08:00" level=fatal msg="failed to get runtime image registry.cn-hangzhou.aliyuncs.com/rancher/rke2-runtime:v1.32.6-rke2r1: all endpoints failed: GET https://registry.cn-hangzhou.aliyuncs.com/v2/rancher/rke2-runtime/manifests/v1.32.6-rke2r1: MANIFEST_UNKNOWN: manifest unknown; map[Tag:v1.32.6-rke2r1]"
Jul 02 23:53:13 ubuntu systemd[1]: rke2-server.service: Main process exited, code=exited, status=1/FAILURE


应该可以了,你在试试

Nice!镜像仓库可以使用了,就是速度特别慢,不知道是我的网速问题,还是普遍现象。
其他人有遇到类似下载慢的问题么,欢迎留言~

用的是免费版的阿里云镜像仓库,有限速,当同事拉取的人多了,就会慢,这个后续我想想怎么解决掉