Manage Azure Kubernetes Service (AKS) Cluster from Azure AD-Joined Device | Exam AZ-300 Answer

Deploy YAML Application Manifest for Container Application | Exam AZ-300 Answer

Question

You have an Azure Kubernetes Service (AKS) cluster named Clus1 in a resource group named RG1.

An administrator plans to manage Clus1 from an Azure AD-joined device.

You need to ensure that the administrator can deploy the YAML application manifest file for a container application.

You install the Azure CLI on the device.

Which command should you run next?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

kubectl apply ""f appl.yaml applies a configuration change to a resource from a file or stdin.

Incorrect Answers:

A: kubectl get nodes gets a list of all nodes.

B: az aks install-cli download and install the Kubernetes command-line tool.

D: az aks get-credentials gets access credentials for a managed Kubernetes cluster

https://kubernetes.io/docs/reference/kubectl/overview/ https://docs.microsoft.com/en-us/cli/azure/aks

The correct answer to the question is option D: az aks get-credentials --resource-group RG1 --name Clus1.

Explanation: To manage the Azure Kubernetes Service (AKS) cluster named Clus1 from an Azure AD-joined device, the following steps need to be followed:

  1. Install the Azure CLI on the device: The Azure CLI is a command-line interface for managing Azure resources. To install the Azure CLI on the device, run the following command:

    curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

  2. Authenticate the device with Azure AD: To authenticate the device with Azure AD, run the following command:

    az login

    This command will open a browser window prompting the user to enter their Azure AD credentials. After entering the credentials, the user will be authenticated and returned to the command prompt.

  3. Get the credentials for the AKS cluster: To manage the AKS cluster from the device, the user needs to get the credentials for the AKS cluster. To get the credentials, run the following command:

    az aks get-credentials --resource-group RG1 --name Clus1

    This command will download and install the Kubernetes configuration file for the AKS cluster and merge it with the user's local Kubernetes configuration file. The user can then use the Kubernetes command-line tool (kubectl) to manage the AKS cluster.

  4. Deploy the YAML application manifest file: To deploy the YAML application manifest file for a container application, the user needs to run the following command:

    kubectl apply -f app.yaml

    This command will deploy the container application to the AKS cluster.

Therefore, the correct answer is option D: az aks get-credentials --resource-group RG1 --name Clus1.