8

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 --docker-email=SomeOne@outlook.com --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.

Herman
  • 2,832
  • 6
  • 25
  • 37
  • What is your yaml file ? – pb100 Jul 15 '18 at 05:26
  • @przemolb I didn't have the deployments.yaml, basically I check this video AKS on Azure. Any help appreciates it. Link --> https://www.youtube.com/watch?v=HMIxLaisKiI – Herman Jul 20 '18 at 08:05

4 Answers4

1

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.

Necevil
  • 2,802
  • 5
  • 25
  • 42
  • Are you able to check out this video, I do not have deployments.yaml --> https://www.youtube.com/watch?v=HMIxLaisKiI – Herman Jul 20 '18 at 08:08
1

I need to grant AKS access to ACR.

Please refer to the link here

Herman
  • 2,832
  • 6
  • 25
  • 37
0

How to pass image pull secret while using 'kubectl run' command?

This should help, you need to override the kubectl command with "imagepullsecrets":"cisecret".

Abhirup Guha
  • 122
  • 1
  • 11
  • I try it put on the arguments in VSO under arguments, it doesn't work. I think the link is related to others environment. – Herman Jun 30 '18 at 09:27
0

Add the following in yaml file. imagePullSecrets: - name: acr-auth