Combine Azure Log Analytics with an AKS Cluster
Explore how to connect Azure Log Analytics with an AKS cluster by enabling the monitoring addon. Understand how logs are collected, shipped, and queried within the Azure portal. Learn to use query filters and customize log views to analyze Kubernetes logs efficiently. This lesson helps you integrate central logging solutions for better cluster monitoring.
We'll cover the following...
Enable AKS addon for logging #
Just like GKE (and unlike EKS), AKS comes with an integrated logging solution. All we have to do is enable one of the AKS addons. To be more precise, we’ll enable the monitoring addon. As the name indicates, the addon not only fulfills the need to collect logs, but it also handles metrics. However, we are interested just in logs. I believe that nothing beats Prometheus for metrics, especially since it integrates with HorizontalPodAutoscaler. Still, you should explore AKS metrics as well and reach your own conclusion. For now, we’ll explore only the logging part of the addon.
az aks enable-addons \
-a monitoring \
-n devops25-cluster \
-g devops25-group
The output is a rather big JSON with all the information about the newly enabled monitoring addon. There’s nothing exciting about it.
It’s important to note that we could have enabled the addon when we created the cluster by adding -a monitoring ...