简体   繁体   English

Kubectl 运行后的 ImagePullBackOff

[英]ImagePullBackOff after Kubectl run

I am new to Kubernetes.我是 Kubernetes 的新手。 I am using Minikube for Mac with VM hyperkit.我正在使用带有 VM hyperkit 的 Minikube for Mac。 I also have docker-desktop installed (in which I have tried both enable/disable Kubernetes).我还安装了 docker-desktop(我尝试过启用/禁用 Kubernetes)。

docker pull is executed smoothly with no error. docker pull 执行顺利,没有错误。

but on但在

kubectl run kubernetes-jenkins --image=jenkins:latest --port=8080 

(or any image, be it gcr.io/google-samples/kubernetes-bootcamp:v1) it fails with ImagePullBackOff (或任何图像,无论是 gcr.io/google-samples/kubernetes-bootcamp:v1)它因ImagePullBackOff而失败

Trimming few parts from kubectl cluster-info dump :kubectl cluster-info dump修剪一些部分:

I1230 10:20:56.812648 1 serving.go:312] Generated self-signed cert in-memory W1230 10:20:58.777494 1 configmap_cafile_content.go:102] unable to load initial CA bundle for: "client-ca::kube-system::extension-apiserver-authentication::client-ca-file" due to: configmap "extension-apiserver-authentication" not found W1230 10:20:58.778005 1 configmap_cafile_content.go:102] unable to load initial CA bundle for: "client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file" due to: configmap "extension-apiserver-authentication" not found W1230 10:20:58.849619 1 authorization.go:47] Authorization is disabled W1230 10:20:58.850375 1 authentication.go:92] Authentication is disabled I1230 10:20:56.812648 1 services.go:312] 在内存中生成自签名证书 W1230 10:20:58.777494 1 configmap_cafile_content.go:102] 无法加载初始 CA 包:“client-ca::kube- system::extension-apiserver-authentication::client-ca-file" 原因:找不到 configmap "extension-apiserver-authentication" W1230 10:20:58.778005 1 configmap_cafile_content.go:102] 无法加载初始 CA 包: “client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file”由于:未找到配置映射“extension-apiserver-authentication” W1230 10:20:58.849619 1 authorization.go: 47] 授权被禁用 W1230 10:20:58.850375 1 authentication.go:92] 身份验证被禁用

"reason": "Failed", "message": "Failed to pull image \\"jenkins:latest\\": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/ : dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.3:38558-\>192.168.64.1:53: read: connection refused", "source": { "component": "kubelet", "host": "minikube" } "reason": "Failed", "message": "Failed to pull image \\"jenkins:latest\\": rpc error: code = Unknown desc = 来自守护进程的错误响应:获取https://registry-1.docker.io /v2/ : dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.3:38558-\>192.168.64.1:53: read: connection denied", "source": { “组件”:“kubelet”,“主机”:“minikube” }

Why kubectl is unable to pull image from the repository?为什么 kubectl 无法从存储库中拉取镜像?

In minikube your local docker registry docker image can't be found,so you have to set your docker env to use minikube registry for local image you build and pull在 minikube 中找不到本地 docker 注册表 docker 映像,因此您必须将 docker env 设置为将 minikube 注册表用于构建和拉取的本地映像

eval $(minikube docker-env)

if that doesn't solve your problem, you have to start minikube by telling it's registry如果这不能解决您的问题,您必须通过告诉它的注册表来启动 minikube

minikube start --vm-driver="virtualbox" --insecure-registry=$(docker-machine ip registry):80

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM