CLI Cheatsheet¶
Keep these commands nearby for common AKS tasks. Use long flags for readability and auditability.
Topic/Command Groups¶
flowchart TD
A[CLI Cheatsheet] --> B[Cluster]
A --> C[Node Pools]
A --> D[Workloads]
A --> E[Troubleshooting] Cluster lifecycle¶
az aks list --output table
az aks show --resource-group $RG --name $CLUSTER_NAME --output yaml
az aks get-credentials --resource-group $RG --name $CLUSTER_NAME --overwrite-existing
az aks get-upgrades --resource-group $RG --name $CLUSTER_NAME --output table
Node pools¶
az aks nodepool list --resource-group $RG --cluster-name $CLUSTER_NAME --output table
az aks nodepool show --resource-group $RG --cluster-name $CLUSTER_NAME --name <pool-name> --output yaml
az aks nodepool scale --resource-group $RG --cluster-name $CLUSTER_NAME --name <pool-name> --node-count 5
Kubernetes objects¶
kubectl get nodes -o wide
kubectl get pods -A -o wide
kubectl get svc -A
kubectl get ingress -A
kubectl get events -A --sort-by=.lastTimestamp
Usage Notes¶
- Keep environment variables like
$RGand$CLUSTER_NAMEconsistent across scripts. - Prefer
--output yamlor--output jsonwhen you need evidence for incident notes. - Use namespace-qualified
kubectlcommands during incidents to reduce ambiguity.