0
votes

I am using minikube to develop my Kubernetes application. I have a private azure registry where my images are saved. Whenever I start the app, k8s start to pull an image. It throws the following error

Failed to pull image "myregistry.azurecr.io/myapp:mytag": rpc error: code = Unknown desc = Error response from daemon: Get https://myregistry.azurecr.io/v2/myapp/manifests/mytag: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.

I am configuring my minikube using this documentation. where first, I log-in to acr using below command,

az acr login --name myregistry.azurecr.io --expose-token

And after using the token provided by the above command, I log-in to my private docker-registry by the below command in minikube ssh.

docker login myregistry.azurecr.io -u 00000000-0000-0000-0000-000000000000

After that as per mention in the document, I copy the .docker/config.json to /var/lib/kubelet/config.json in minikube ssh. Still I am facing above error.

If I manually pull the image using the docker pull command, it works. I tried with imagepullsecret also and it is working. But from the above method, getting an authentication error. Do I have missing any step here? Can you please help me?

Thanks...

1
Any more updates on the question? Does it solve your problem?Charles Xu

1 Answers

0
votes

It seems all the steps are right. Maybe you can check if you really copy the config file to all the minikube nodes. In default, the command minikube ssh connect the control plane. You can check if the nodes' IP addresses is right when you copy the config file to them.

But in my opinion, it's not a good way to use the way like this. It's better and more convenient to use the imagePullSecret and service account.