You create the following resources in an Azure subscription:
-> An Azure Container Registry instance named Registry1
-> An Azure Kubernetes Service (AKS) cluster named Cluster1
You create a container image named App1 on your administrative workstation.
You need to deploy App1 to Cluster1.
What should you do first?
Click on the arrows to vote for the correct answer
A. B. C. D.C
You should sign in and push a container image to Container Registry.
Run the az acr build command to build and push the container image. az acr build \
--image contoso-website \
--registry $ACR_NAME \
--file Dockerfile .
https://docs.microsoft.com/en-us/learn/modules/aks-deploy-container-app/5-exercise-deploy-appThe correct answer is C. Run the az acr build command.
Explanation: Before deploying the container image to AKS cluster, the container image needs to be stored in a registry. In this scenario, the container image is stored in the Azure Container Registry (ACR) instance named Registry1. To deploy the container image to Cluster1, we need to follow these steps:
docker tag app1 registry1.azurecr.io/app1
az acr login
.push
command: docker push registry1.azurecr.io/app1
kubectl apply
command to deploy the container image to the AKS cluster: kubectl apply -f deployment-manifest.yaml
However, the scenario already provides that the container image named App1 is created on the administrative workstation. So, we can directly use the Azure CLI command az acr build
to build the container image and push it to the ACR instance. This command will also create the Kubernetes deployment manifest file automatically.
Therefore, the correct answer is C. Run the az acr build command.