AliyunContainerService / minikube

普大喜奔,官方Minikube提供了完整对国内用户支持,完美支持Addon组件。 建议参考 https://yq.aliyun.com/articles/221687 或 https://github.com/AliyunContainerService/minikube/wiki 最新支持minikube v1.24.0
Apache License 2.0
1.28k stars 151 forks source link

minikube addon registry 中image digest错误导致无法拉取镜像 #66

Open smartheye opened 3 years ago

smartheye commented 3 years ago

重现问题所需的命令: minikube addons enable registry

失败的命令的完整输出

Failed to pull image "registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1@sha256:d5459fcb27aecc752520df4b492b08358a1912fcdfa454f7d2101d4b09991daa": rpc error: code = Unknown desc = Error response from daemon: manifest for registry.cn-hangzhou.aliyuncs.com/google_containers/registry@sha256:d5459fcb27aecc752520df4b492b08358a1912fcdfa454f7d2101d4b09991daa not found: manifest unknown: manifest unknown
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1 2.7.1: Pulling from google_containers/registry 6a428f9f83b0: Pull complete 90cad49de35d: Pull complete b215d0b40846: Pull complete 429305b6c15c: Pull complete 6f7e10a4e907: Pull complete Digest: sha256:265d4a5ed8bf0df27d1107edb00b70e658ee9aa5acb3f37336c5a17db634481e Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1 registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1

minikube logs命令的输出

Sep 23 15:02:51 minikube kubelet[3081]: E0923 15:02:51.937514 3081 pod_workers.go:747] "Error syncing pod, skipping" err="failed to \"StartContainer\" for \"registry\" with ImagePullBackOff: \"Back-off pulling image \\\"registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1@sha256:d5459fcb27aecc752520df4b492b08358a1912fcdfa454f7d2101d4b09991daa\\\"\"" pod="kube-system/registry-8fxq4" podUID=612adaf0-19c8-488f-a240-9a69c4b14c08

使用的操作系统版本: MacOS 11.6

CWL-1688 commented 2 years ago

你好,这个问题最后怎么解决的呢?

CWL-1688 commented 2 years ago

找到对应的replication controller

kubectl get rc -n kube-system 编辑rc配置 kubectl edit rc -n kube-system registry 修改其中的image地址,将其改为registry:2.7.1 删除pod,等待自动重新创建

以上操作需要集群可以科学上网

ruinshe commented 2 years ago

TL;DR using the command line below:

kubectl patch -n kube-system rc registry -p '{"spec":{"template":{"spec":{"containers":[{"name":"registry","image": "registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1"}]}}}}'
kubectl delete pod -n kube-system -l actual-registry=true

FYI, just a temporary fix, you can just edit the deploy and remove the digest after @sha256=, i.e. using registry.cn-hangzhou.aliyuncs.com/google_containers/registry:2.7.1 directly.

Not sure why the mirrored image on AliCloud is mismatched with the official one