In the previous article, we did the AKS cluster deployment successfully. Now we have to access our deployed cluster, and for that we will use the Azure Cloud Shell. But first we have to know about Azure Cloud Shell. Let’s start.
What is Azure Cloud Shell?
Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.
Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Azure Cloud Shell runs on Ubuntu 16.04 LTS.
You can access the Cloud Shell in the following ways,
- Direct link: Open a browser to here.
- Azure portal: Select the Cloud Shell icon on the Azure portal
Access Azure Kubernetes Cluster Using Azure Cloud Shell
Once you log-in find and click the small Cloud Shell icon near the search bar, as shown in the picture.
The portal will ask you to select either PowerShell or Bash as your default shell experience. As we will be working with mainly Linux workloads, please select Bash.
If this is the first time you have launched Cloud Shell, you will be asked to create a storage account; confirm, and create it.
You might get an error message that contains a mount storage error. If that error occurs, please restart your Cloud Shell.
Click on the power button. It should restart, and you should see something similar to
The command-line tool that is used to interface with Kubernetes clusters is called kubectl. The benefit of using Azure Cloud Shell is that this tool, along with many others, comes preinstalled and is regularly maintained. kubectl uses a configuration file stored in ~/.kube/config to store credentials to access your cluster.
To get the required credentials to access your cluster; in my case cluster name is rh-k8s-training, you need to type the following command:
az aks get-credentials –resource-group rh-k8s-training –name rh-k8s-training
To verify that you have access, type the command: kubectl get nodes. You should see the output as mentioned in the screenshot.
Finally, we have verified that we can connect to our AKS cluster.