In this section, we are going to connect to the cluster using kubectl from Azure Cloud Shell. The kubectl client is preinstalled in Azure Cloud Shell. Let's get started:
- Navigate to the Azure portal by opening https://portal.azure.com.
- In the top-right menu of the Azure portal, select Azure Cloud Shell.
- First, we need to connect to our Kubernetes cluster. To do so, add the following line of code (the subscription method is optional):
az aks get-credentials
--resource-group PacktAKSResourceGroup
--name PacktAKSCluster
--subscription "<your-subscription-id>"
- To verify the connection to your cluster, return a list of the cluster nodes:
kubectl get nodes
- The following output displays the cluster of nodes:
Cluster of nodes
In this section, we connected to the AKS cluster using the CLI. In the next section, we are going to deploy the application.