Connect to Azure Kubernetes Service (AKS) CLI

    Connect to Azure Kubernetes Service (AKS) CLI Follow this steps to connecto to your AKS Cluster through the Azure CLI. What is Kubectl? Its the command-line interface to interact with your Kubernetes Cluster Control Pane through the kube-ap


    Follow this steps to connecto to your AKS Cluster through the Azure CLI.

    What is Kubectl?

    Its the command-line interface to interact with your Kubernetes Cluster Control Pane through the kube-apiserver (K8S API). Whit this CLI Tool for K8S you can do almost anything within your cluster. It’s one of the most important tools to interact with the configuration.

    Install Azure CLI

    • Download the CLI (Windows x64)
    • Login to Azure using the az login cmd to log into your Azure account:
    Bash
    az login
    • Run the az account list --output table and find your subscriptionId:
    Bash
    az account list --output table
    • Set your subscription context:
    Bash
    az account set –subscription <SubscriptionId>
    • Check version:
    Bash
    az --version

    Install kubectl for AKS

    To install the tool, open the CMD/PowerShell and run the following cmd

    Bash
    az aks install-cli

    Get your cluster credentials and connect

    Get your cluster credentials and connect to AKS cli:

    Bash
    az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

    Interact with your cluster

    Now you can use the g the kubectl cmd-line as you would to interact with any cluster. For example, you can use the following:

    Bash
    kubectl get pods
    kubectl get nodes

    Thanks for reading. The learning continues in the next article.