🦐Cloud Shell - Configure kubectl to connect to AKS Cluster

Go to https://shell.azure.com​

Template

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

Replace Resource Group & Cluster Name

az aks get-credentials --resource-group aks-clus-rg01 --name rk-aks-cluster01

Get kubectl client version only (shows client version only (no server required))

kubectl version --client=true

Get kubectl version (Displays both client CLI and k8s server versions)

kubectl version

List Kubernetes Worker Nodes

kubectl get nodes kubectl get nodes -o wide

Explore Cluster Control Plane and Workload inside that

List Namespaces

kubectl get namespaces

kubectl get ns

List Pods from all namespaces

kubectl get pods --all-namespaces

List all k8s objects from Cluster Control plane

kubectl get all --all-namespaces

Explore AKS Cluster using kubectl and Azure Mgmt Console

  • Explore the following features on high-level

    • Overview

    • Kubernetes Resources

    • Settings

    • Monitoring

    • Automation

Local Desktop - Install Azure CLI and Azure AKS CLI

Install Azure CLI (MAC)

brew update && brew install azure-cli

Verify AZ CLI version

az --version

Install Azure AKS CLI

sudo az aks install-cli

Get kubectl client version only (shows client version only (no server required))

kubectl version --client=true

Get kubectl version (Displays both client CLI and k8s server versions)

kubectl version

Login to Azure

az login

Configure Cluster Creds (kube config)

az aks get-credentials --resource-group aks-rg1 --name aksdemo1

List AKS Nodes

kubectl get nodes kubectl get nodes -o wide

Reference Documentation Links

Last updated