I got this job after reading this information.
http://kubernetes.io/docs/user-guide/images/#specifying-imagepullsecrets-on-a-pod
So, first create a registry key
kubectl create secret docker-registry myregistrykey --docker-server=https://myregistry.azurecr.io --docker-username=ACR_USERNAME --docker-password=ACR_PASSWORD --docker-email=ANY_EMAIL_ADDRESS
Replace the server address with the address of your ACR address and USERNAME, PASSWORD, and EMAIL address with values ββfrom the admin user for your ACR. Note. Email address may be a value.
Then in the deployment, you simply tell the Kubernets to use this key to pull the image as follows:
kind: Deployment apiVersion: extensions/v1beta1 metadata: name: jenkins-master spec: replicas: 1 template: metadata: name: jenkins-master labels: name: jenkins-master spec: containers: - name: jenkins-master image: myregistry.azurecr.io/infrastructure/jenkins-master:1.0.0 imagePullPolicy: Always readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 20 timeoutSeconds: 5 ports: - name: jenkins-web containerPort: 8080 - name: jenkins-agent containerPort: 50000 imagePullSecrets: - name: myregistrykey
source share