简体   繁体   中英

Starting minikube in a Linux box requires authentication with Google Container Registry, why?

I am currently learning Kubernetes and I am playing with minikube tool. I have decided to install the tool in a VirtualBox instance that runs ubuntu/xenial64. I have created this instance using Vagrant and connected the instance through ssh. I have installed minikube in accordance to the tool documentation - https://minikube.sigs.k8s.io/docs/start/ . When I run: $ minikube start , it failed with the following message:

$ minikube start
😄  minikube v1.11.0 on Ubuntu 16.04 (vbox/amd64)
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
📶  Unfortunately, could not download the base image gcr.io/k8s-minikube/kicbase:v0.0.10 
❗  In order to use the fall back image, you need to log in to the github packages registry
📘  Please visit the following link for documentation around this: 
    https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages

💡  Please either authenticate to the registry or use --base-image flag to use a different registry.

For some reason, in order to download minikube base image, it requires to authenticate to the gcr.io registry (Google Container Registry). The minikube documentation does mention nothing about this requirement. I am wondering why it happened. My understanding is it should not be mandatory to have a gsr account in order to use minikube. What am I doing wrong? And what is the kicbase container (KIC) that minikube depends on? I appreciate any help on this problem. Thank you.

The first answer only explains part of the problem here. Your real problem is that you may need a proxy to communicate with gcr.io/k8s-minikube/kicbase (or you are in a restricted network), as mentioned here: https://github.com/kubernetes/minikube/issues/8124#issuecomment-628172092 . This would be particularly true if you are running under a VPN.

In my case, I was able to docker pull the kicbase image without the need of a proxy :

$ docker pull gcr.io/k8s-minikube/kicbase:v0.0.10
Trying to pull repository gcr.io/k8s-minikube/kicbase ... 
v0.0.10: Pulling from gcr.io/k8s-minikube/kicbase
Digest: sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438
Status: Image is up to date for gcr.io/k8s-minikube/kicbase:v0.0.10

And then, I was able to start the minikube with the following command:

$ minikube start --base-image=gcr.io/k8s-minikube/kicbase:v0.0.10
😄  minikube v1.11.0 on Centos 7.8.2003
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=2200MB) ...
🐳  Preparing Kubernetes v1.18.3 on Docker 19.03.2 ...
    ▪ kubeadm.pod-network-cidr=10.244.0.0/16
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube"

I would also recommend you to check the images you have on your docker ( docker images ) and delete ( docker rmi ) old versions of the kicbase (I had here versions v0.0.7, v0.0.8 and v0.0.10).

If even the manual docker pull does not solve the problem for you, you will really need to set up a proxy. There's a good reference on how to do that here .

Edit: added up some info on how to configure the proxy.

It's not requesting you to login to gcr.io. It's falling back to use github registry for the image. And github require at least read permission to pull images. https://github.com/kubernetes/minikube/pull/8225

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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