4
votes

I was following the steps in this Microsoft tutorial: https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-acr#container-registry-login

I've created a resource group, and then an azure container registry with "az acr create". The next step is to login to the registry, but I keep getting this error: Error response from daemon: Get https://azurereg.azurecr.io/v2/: Service Unavailable

Any ideas?

1
Could you please try to use docker login command with username and password? docker login myregistry.azurecr.io -u xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p myPasswordJason Ye
@JasonYe-MSFT There is no username and password for it, but even if i enter any credentials, it still responds with the same error, service unavailable.user9623839
Could you please check the resouce status via Azure portal?Jason Ye
@JasonYe-MSFT It is available. I'm wondering if it might be a proxies (connection) issue?user9623839
@screamingworld i met the same issue, i restarted my docker application, and then it works.csamleong

1 Answers

0
votes

In order to access ACR from AKS, you can use the underlying service principal. That said, you've to create a role assignment for the Service Principal as mentioned in this paragraph https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks?toc=%2fazure%2faks%2ftoc.json#grant-aks-access-to-acr

Creating a role assignment for role Reader currently doesn't work. You've to create the assignment for the Owner role. (described in https://github.com/Azure/AKS/issues/76).

Keep in mind that K8s caches the token for a couple of minutes. It took 3-5 minutes on my cluster to work.