Connecting to the cluster

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:

  1. Navigate to the Azure portal by opening https://portal.azure.com.
  2. In the top-right menu of the Azure portal, select Azure Cloud Shell.
  3. 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>"
  1. To verify the connection to your cluster, return a list of the cluster nodes:
kubectl get nodes
  1. 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset