Minikube: ! VM is unable to access k8s.gcr.io, you may need to configure a proxy or set --image-repository

Created on 7 Nov 2019  ·  15Comments  ·  Source: kubernetes/minikube

重现问题所需的命令

失败的命令的完整输出

minikube logs命令的输出

使用的操作系统版本

kinsupport zh-CN needs-faq-entry triagneeds-information

Most helpful comment

I have solved that with the following command:

$ minikube start \
--driver=${DRIVER} \
--registry-mirror=${DOCKER_REGISTRY_MIRROR} \
--image-mirror-country=cn \
--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

All 15 comments

@damangueyu it seems like you dont have access to k8s.gcr.io.

do you mind to try to start minikube with this option ?

minikube start --image-mirror-country=cn

i did it
minikube start --image-mirror-country=cn
but it happened again

try this option --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

I have solved that with the following command:

$ minikube start \
--driver=${DRIVER} \
--registry-mirror=${DOCKER_REGISTRY_MIRROR} \
--image-mirror-country=cn \
--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

k8s.gcr.io.

A common China issue. The docker registry is intermittently reachable. A
registry-mirror is suggested to be used (as also done)

On Mon, Nov 18, 2019 at 5:46 PM Xavier Zhao notifications@github.com
wrote:

I have solved that with the following command:

$ minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/minikube/issues/5860?email_source=notifications&email_token=AAAAOZW4KQLSETIHRKY4LGTQUJP6NA5CNFSM4JKGZKL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEJ23YI#issuecomment-554937825,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAAOZRL7Z3GZPV2W5PFZLLQUJP6NANCNFSM4JKGZKLQ
.

--

Gerard Braad | http://gbraad.nl
[ Doing Open Source Matters ]

minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

This does not work for me. I got "failed: UNAUTHORIZED: "authentication required"

https://stackoverflow.com/questions/54803393/run-minikube-start-cannot-pull-k8s-gcr-images-but-docker-pull-can-do/59350432#59350432

This works for me.

minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

This does not work for me. I got "failed: UNAUTHORIZED: "authentication required"

Get the same issue. This is my command:

$ minikube start --image-mirror-country=cn --iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.6.0.iso --registry-mirror=https://dockerhub.azk8s.cn  --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --vm-driver="hyperv" --hyperv-virtual-switch="minikube v switch"  --memory=4096 

@littlesmilelove does the answer provided here help ? https://github.com/kubernetes/minikube/issues/5860#issuecomment-554937825

@littlesmilelove does the answer provided here help ? #5860 (comment)

Yes, it does. But the first time I run it failed. I need to retry a few times. The minikube version is V1.6.0.

Hey @damangueyu @littlesmilelove has this issue been resolved for you?

$ minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
occured error
image

It worked when i deleted --image-mirror-country=cn

$ minikube start --vm-driver=virtualbox --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
occured error
image

it's a bug, see https://github.com/kubernetes/minikube/issues/7052

I use the following commands and it works.
minikube start --vm-driver=hyperkit --registry-mirror=https://registry.docker-cn.com --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

Output:
`😄 Darwin 10.15.3 上的 minikube v1.9.2
✨ 根据现有的配置文件使用 hyperkit 驱动程序
💾 正在下载驱动 docker-machine-driver-hyperkit:

docker-machine-driver-hyperkit.sha256: 65 B / 65 B [---] 100.00% ? p/s 0s
docker-machine-driver-hyperkit: 10.90 MiB / 10.90 MiB 100.00% 385.92 KiB
🔑 The 'hyperkit' driver requires elevated permissions. The following commands will be executed:

$ sudo chown root:wheel /Users/hao/.minikube/bin/docker-machine-driver-hyperkit
$ sudo chmod u+s /Users/hao/.minikube/bin/docker-machine-driver-hyperkit

✅ 正在使用镜像存储库 registry.cn-hangzhou.aliyuncs.com/google_containers
👍 Starting control plane node m01 in cluster minikube
💾 Downloading Kubernetes v1.18.0 preload ...
🔥 Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳 正在 Docker 19.03.8 中准备 Kubernetes v1.18.0…

kubelet.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
kubectl.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
kubeadm.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
kubeadm: 37.96 MiB / 37.96 MiB [------------] 100.00% 96.00 KiB p/s 6m45s
kubectl: 41.98 MiB / 41.98 MiB [-----------] 100.00% 104.16 KiB p/s 6m53s
kubelet: 81.34 MiB / 108.01 MiB [------>_] 75.31% 73.08 KiB p/s ETA 6m13s
kubelet: 81.39 MiB / 108.01 MiB [------>_] 75.36% 73.08 KiB p/s ETA 6m12s
kubelet: 104.37 MiB / 108.01 MiB [-------->] 96.63% 73.19 KiB p/s ETA 50s
kubelet: 108.01 MiB / 108.01 MiB [---------] 100.00% 49.51 KiB p/s 37m14s
🌟 Enabling addons: default-storageclass, storage-provisioner
🏄 完成!kubectl 已经配置至 "minikube"
`

Was this page helpful?
0 / 5 - 0 ratings