Diagnostic Commands¶
These commands are grouped by investigation goal so you can collect evidence quickly during AKS incidents.
Topic/Command Groups¶
flowchart TD
A[Diagnostics] --> B[Cluster State]
A --> C[Pods]
A --> D[Networking]
A --> E[Nodes]
A --> F[Azure Resource State] Cluster and workload state¶
kubectl get nodes -o wide
kubectl get pods -A -o wide
kubectl get events -A --sort-by=.lastTimestamp
kubectl top nodes
kubectl top pods -A
Pod-specific investigation¶
kubectl describe pod <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace> --previous
kubectl get deployment <deployment-name> -n <namespace> -o yaml
Networking and ingress¶
kubectl get svc -A
kubectl get endpoints -A
kubectl get ingress -A
kubectl describe ingress <ingress-name> -n <namespace>
kubectl exec -it <pod-name> -n <namespace> -- nslookup <service-name>
Azure-side checks¶
az aks show --resource-group $RG --name $CLUSTER_NAME --output yaml
az aks nodepool list --resource-group $RG --cluster-name $CLUSTER_NAME --output table
az vm list-usage --location $LOCATION --output table
| Command | Purpose |
|---|---|
az aks show | Show the cluster's full properties. |
--resource-group | Resource group that contains the AKS cluster. |
--name | Name of the AKS cluster. |
--output | Output format for the result. |
az aks nodepool list | List the node pools in the cluster. |
--resource-group | Resource group that contains the AKS cluster. |
--cluster-name | Name of the AKS cluster. |
--output | Output format for the result. |
az vm list-usage | Show regional vCPU quota usage. |
--location | Azure region to query. |
--output | Output format for the result. |
Usage Notes¶
- Capture command output in incident notes before changing configuration.
- Prefer comparing one failing object with one healthy object in the same cluster.
- During severe incidents, start with read-only commands and widen only as evidence improves.