Notes

Tuesday, January 4, 2022

AKS

# Add a cluster to kube config (C:\Users\<username>\.kube\config)
$ az aks get-credentials --name <cluster-name> -g <resource-group> --admin

Log Analytics queries

Query to get the Events for pods in a namespace. Only events of type Warning and above are stored in Log Analytics

// =~ is case insensitive string comparison
KubeEvents
| where ClusterName =~ '<cluster name>'
| where ObjectKind =~ 'Pod'
| where Namespace =~ '<namespace>'
| order by TimeGenerated desc 
| take 100