[*]
In this tutorial, I’m showing how to configure Azure ACR with Kubernetes. This will allow you pull or push docker images from you private repository hosted on Azure Container Registry.
The steps involve creating a service principal and testing the it’s credentials using docker cli, then with that created account, I created a secret into my kubernetes cluster, which then I use as an image pull secret to pull my container image from my private Azure Container Registry.
Commands used during the video:
======================
# Query the registry ID
az acr show –name k8srepo –query id –output tsv
# Get the service principal password
az ad sp create-for-rbac –name –scopes (REGISTRY-ID) `
–role acrpull –query password –output tsv
# Get the service principal appId
az ad sp show –id –query appId –output tsv
# pull an image
docker pull hello-world
# Log in to Docker with service principal credentials
docker login k8srepo.azurecr.io –username (SP_APP_ID) –password (SP_PASSWD)
az acr login –name k8srepo
# tag and push the docker image
docker tag hello-world k8srepo.azurecr.io/hello-world:v2
docker push k8srepo.azurecr.io/hello-world:v2
# Create the image pull secret
kubectl create secret docker-registry k8srepo
–namespace default
–docker-server=k8srepo.azurecr.io
–docker-username=(service-principal-ID)
–docker-password=(service-principal-password)
Hope you find it helpful, if the mood strike hit that like button.
=========
Subscribe
=========
Don’t miss any future video! hit that subscribe button and click the bell notification icon to be alerted of new videos I release.
====================
You can follow me on :
====================
[*] Github:
[*] Website:
[*] Linkedin:
[*] Twitter:
source