简体   繁体   English

Kubectl 在通过 minikube 创建部署时抛出 ImagePullBackOff 错误

[英]Kubectl throws ImagePullBackOff Error while creating deployment via minikube

Trying to create a deployment from an image尝试从映像创建部署

kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10

and then do kubectl get pods and check the logs of hello-minikube pod using然后使用kubectl get pods并检查 hello-minikube pod 的日志

kubectl pod describe <pod-name> throws following error 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

This error can be solved using :可以使用以下方法解决此错误:

  1. Check whether any docker machine is running or not by docker-machine ls通过docker-machine ls检查是否有任何 docker 机器正在运行

  2. If no machine exist, then create one using docker-machine create <machine-name>如果不存在机器,则使用docker-machine create <machine-name>创建一docker-machine create <machine-name>

  3. Then get this machine IP using docker-machine ip <machine-name>然后使用docker-machine ip <machine-name>获取这台机器IP

  4. Then first delete any existing minikube cluster using minikube delete and start again using minikube start --vm-driver="virtualbox" --insecure-registry="docker-machine IP":80然后首先使用minikube delete删除任何现有的 minikube 集群,然后使用minikube start --vm-driver="virtualbox" --insecure-registry="docker-machine IP":80

  5. Then run kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10 and check the logs, it will show image pulled successfully.然后运行kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10并检查日志,它会显示成功拉取图像。

From the events it looks like the call to a DNS server at 192.168.64.1:53 to resolve k8s.gcr.io is failing.从事件来看,调用192.168.64.1:53的 DNS 服务器来解析 k8s.gcr.io 似乎失败了。 Check if there's a DNS server running at that IP.检查是否有在该 IP 上运行的 DNS 服务器。 It may be configured in /etc/resolv.conf (if Linux) on the minikube host.它可以在 minikube 主机上的/etc/resolv.conf (如果是 Linux)中配置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果 minikube 以超过 1 个节点启动,kubectl 无法从本地映像创建部署 - kubectl fails at creating deployment from local image if the minikube started with more than 1 node 使用 Minikube 的 ImagePullBackOff 本地存储库 - ImagePullBackOff local repository with Minikube 在从属计算机上运行kubernetes部署时出现ImagePullBackOff错误,在主计算机上存在docker docker映像 - ImagePullBackOff error while running kubernetes deployment on slave machine , where docker docker image is present in master machine Kubectl 运行后的 ImagePullBackOff - ImagePullBackOff after Kubectl run 用于 Windows Kubernetes pod 的 Docker 在创建新部署后获取 ImagePullBackOff - Docker for Windows Kubernetes pod gets ImagePullBackOff after creating a new deployment 在 gitlab ci 作业中使用 kubectl 创建 ImagePullSecret 时出现奇怪错误 - Strange Error while creating ImagePullSecret with kubectl in gitlab ci job 在创建 Kubernetes pod 时在 EC2 实例上获取 ImagePullBackOff - Getting ImagePullBackOff on EC2 instance while creating Kubernetes pods 使用 kubectl 和 minikube 时无法连接到远程服务器错误 - Unable to connect to the remote server error when using kubectl and minikube “kubectl get pods”显示状态 - ImagePullbackOff - “kubectl get pods” showing STATUS - ImagePullbackOff 在使用docker安装时,&#39;Kubectl&#39;抛出错误&#39;未能协商api版本&#39; - 'Kubectl' throws error 'failed to negotiate an api version' while installing using docker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM