问题描述:
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