尝试从映像创建部署
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
然后执行kubectl get pods
并使用
kubectl pod describe <pod-name>
引发以下错误
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned default/hello-minikube-797f975945-dmq26 to minikube
Warning Failed 42s kubelet, minikube Failed to pull image "k8s.gcr.io/echoserver:1.10": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: dial tcp: lookup k8s.gcr.io on 192.168.64.1:53: read udp 192.168.64.3:56747->192.168.64.1:53: read: connection refused
Warning Failed 27s kubelet, minikube Failed to pull image "k8s.gcr.io/echoserver:1.10": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: dial tcp: lookup k8s.gcr.io on 192.168.64.1:53: read udp 192.168.64.3:48279->192.168.64.1:53: read: connection refused
Normal BackOff 16s (x2 over 42s) kubelet, minikube Back-off pulling image "k8s.gcr.io/echoserver:1.10"
Warning Failed 16s (x2 over 42s) kubelet, minikube Error: ImagePullBackOff
Normal Pulling 4s (x3 over 42s) kubelet, minikube Pulling image "k8s.gcr.io/echoserver:1.10"
Warning Failed 4s (x3 over 42s) kubelet, minikube Error: ErrImagePull
Warning Failed 4s kubelet, minikube Failed to pull image "k8s.gcr.io/echoserver:1.10": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: dial tcp: lookup k8s.gcr.io on 192.168.64.1:53: read udp 192.168.64.3:50616->192.168.64.1:53: read: connection refused
答案 0 :(得分:0)
从这些事件看来,调用192.168.64.1:53
的DNS服务器来解析k8s.gcr.io失败。检查是否在该IP上运行DNS服务器。可以在minikube主机上的/etc/resolv.conf
(如果是Linux)中对其进行配置。
答案 1 :(得分:-1)
此错误可以使用解决:
通过docker-machine ls
如果不存在任何计算机,则使用docker-machine create <machine-name>
然后使用docker-machine ip <machine-name>
然后首先使用minikube delete
删除任何现有的minikube集群,然后再次使用minikube start --vm-driver="virtualbox" --insecure-registry="docker-machine IP":80
然后运行kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
并检查日志,它将显示成功提取图像。