使用Minikube的ImagePullBackOff本地存储库

我正在尝试使用minikube和kitematic在本地计算机上测试kubernetes。但是,kubernetes无法在我的本地存储库(ImagePullBackOff)中提取图像。

但是我没有/etc/init.d/docker,我认为是因为运动学?(我在OS X上)

我安装了https://github.com/docker/docker-

registry,并且

docker tag local-image-build localhost:5000/local-image-build

docker push localhost:5000/local-image-build

我的kubernetes yaml包含:

spec:

containers:

- name: backend-nginx

image: localhost:5000/local-image-build:latest

imagePullPolicy: Always

但是仍然无法正常工作… Logs:

Error syncing pod, skipping: failed to "StartContainer" 

for "backend-nginx" with ErrImagePull: "Error while pulling image:

Get http://127.0.0.1:5000/v1/repositories/local-image-build/images:

dial tcp 127.0.0.1:5000: getsockopt: connection refused

我不知道自己是否走上了好路,但是我发现了这一点:

http://kubernetes.io/docs/user-guide/images/

但我不知道我的DOCKER_USER是什么…

kubectl create secret docker-registry myregistrykey --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL

现在我上了吊舱:

Failed to pull image "local-image-build:latest": Error: image library/local-image-build not found

Error syncing pod, skipping: failed to "StartContainer" for "backend-nginx" with ErrImagePull: "Error: image library/local-image-build not found"

帮帮我,我快疯了。

Error syncing pod, skipping: failed to "StartContainer" for "backend-nginx" with ErrImagePull: "Error response from daemon: Get https://192.168.99.101:5000/v1/_ping: tls: oversized record received with length 20527"

我补充说:

EXTRA_ARGS='

--label provider=virtualbox

--insecure-registry=192.168.99.101:5000

到我的docker config,但仍然无法正常工作,出现相同的消息…。

顺便说一句,我改变了我的yaml:

 spec:

containers:

- name: backend-nginx

image: 192.168.99.101:5000/local-image-build:latest

imagePullPolicy: Always

我这样运行注册表:

docker run -d -p 5000:5000 --restart=always --name myregistry registry:2

回答:

我想我解决了

minikube start --vm-driver="virtualbox" --insecure-registry="$REG_IP":80

而不只是

minikube start

$ REG_IP是:

REG_IP=docker-machine ip registry

资源

以上是 使用Minikube的ImagePullBackOff本地存储库 的全部内容, 来源链接: utcz.com/qa/431047.html

回到顶部