Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes: Failed to pull image from private container registry

I'm using Azure for my Continuous Deployment, My secret name is "cisecret" using

kubectl create secret docker-registry cisecret --docker-username=XXXXX --docker-password=XXXXXXX [email protected] --docker-server=XXXXXXXXXX.azurecr.io

In my Visual Studio Online Release Task kubectl run Under Secrets section
Type of secret: dockerRegistry
Container Registry type: Azure Container Registry
Secret name: cisecret

My Release is successfully, but when proxy into kubernetes

Failed to pull image xxxxxxx unauthorized: authentication required.

like image 416
Herman Avatar asked Jun 29 '18 06:06

Herman


1 Answers

Could this be due to your container name possibly? I had an issue where I wasn't properly prepending the ACR domain in front of the image name in my Kubernetes YAML which meant I wasn't pointed at the container registry / image and therefore my secret (which was working) appeared to be broken.

Can you post your YAML? Maybe there is something simple amiss since it seems you are on the right track from the secrets perspective.

like image 54
Necevil Avatar answered Sep 21 '22 17:09

Necevil