我试图在我的本地机器上使用minikube和kitematic来测试kubernetes。但是,kubernetes无法在本地存储库中提取图像(ImagePullBackOff)。ImagePullBackOff与Minikube的本地存储库
我尝试用这个问题来解决:Can not pull docker image from private repo when using Minikube
但我没有/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
但它仍然没有工作... 日志:
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
编辑2:
我不知道我是不是好道路,但我觉得这样的:
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
编辑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"
帮助我,我快疯了。
EDIT 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
我泊坞窗的配置,但它仍然不工作,同样的消息....
顺便说一句,我改变了我的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
你在OS X上? – manojlds
是的,我在OS X上 – Xero
你真的运行过注册表吗?执行命令是'docker run -d -p 5000:5000 --name注册表注册表:2' – Nebril