检查

kubectl get pod -A

一般情况都是kubernetes-dashboard命名空间下的容器镜像拉取出错

NAMESPACE              NAME                                         READY   STATUS              RESTARTS      AGE
kube-system            coredns-65c54cc984-4km8g                     1/1     Running             0             101s
kube-system            etcd-minikube                                1/1     Running             0             112s
kube-system            kube-apiserver-minikube                      1/1     Running             0             112s
kube-system            kube-controller-manager-minikube             1/1     Running             0             112s
kube-system            kube-proxy-6vxh7                             1/1     Running             0             101s
kube-system            kube-scheduler-minikube                      1/1     Running             0             112s
kube-system            storage-provisioner                          1/1     Running             1 (70s ago)   109s
kubernetes-dashboard   dashboard-metrics-scraper-7db978b848-wpxd4   0/1     ImagePullBackOff    0             100s
kubernetes-dashboard   kubernetes-dashboard-6f4c897964-z7672        0/1     ImagePullBackOff    0             100s

查看日志

kubectl describe pod dashboard-metrics-scraper-7db978b848-wpxd4 -n kubernetes-dashboard

可以看到镜像下载出错了,然后一直重试

Back-off pulling image "kubernetesui/metrics-scraper:v1.0.4"
Error: ImagePullBackOff

手动下载

minikube ssh

我们先从国内库下载镜像,再打上tag

#手动pull
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.4

#打上tag
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.4 docker.io/kubernetesui/metrics-scraper:v1.0.4 
#手动pull
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.0.3

#打上tag
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.0.3 kubernetesui/dashboard:v2.0.3

完成

minikube dashboard

FrontNg
41 声望3 粉丝

Java/Spring Cloud/微服务/Dev-Ops/Linux/Vue.js