使用Minikube的ImagePullBackOff本地存储库 [英] ImagePullBackOff local repository with Minikube
问题描述
我正在尝试使用minikube和kitematic在我的本地机器上测试kubernetes.但是,kubernetes无法在我的本地存储库(ImagePullBackOff)中提取图像.
I'm trying to use minikube and kitematic for testing kubernetes on my local machine. However, kubernetes fail to pull image in my local repository (ImagePullBackOff).
我尝试解决此问题:使用Minikube时无法从私有存储库中提取Docker映像
但是我没有/etc/init.d/docker,我认为是因为运动学? (我在OS X上)
But I have no /etc/init.d/docker, I think it's because of kinematic ? (I am on 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包含:
My kubernetes yaml contains :
spec:
containers:
- name: backend-nginx
image: localhost:5000/local-image-build:latest
imagePullPolicy: Always
但是它仍然无法正常工作... 日志:
But it's still not working... 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
我不知道自己是否走上了一条好路,但是我发现了这一点:
I don't know if I'm on the good path, but I find this :
http://kubernetes.io/docs/user-guide/images/
但是我不知道我的DOCKER_USER是什么...
But I don't know what is my 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
编辑3
现在我上了吊舱:
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"
帮我,我快要疯了.
编辑4
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配置,但仍然无法正常工作,出现相同的消息....
to my docker config, but it's still don't work, the same message....
顺便说一句,我改变了我的Yaml:
By the way, I changed my yaml :
spec:
containers:
- name: backend-nginx
image: 192.168.99.101:5000/local-image-build:latest
imagePullPolicy: Always
然后我像这样运行注册表:
And I run my registry like that :
docker run -d -p 5000:5000 --restart=always --name myregistry registry:2
推荐答案
我认为我通过这样做解决了问题
I think I solved by doing
minikube start --vm-driver="virtualbox" --insecure-registry="$REG_IP":80
而不是仅仅
minikube start
$ REG_IP是:
$REG_IP is :
REG_IP=docker-machine ip registry
这篇关于使用Minikube的ImagePullBackOff本地存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!