Enable Azure Monitor

This guide will walk you through enabling Azure Monitor to collect logs and metrics from your AKS Cluster.

See also

Procedure

  1. Go to your rok-tools management environment and enable the monitoring AKS add-on:

    root@rok-tools:~# az aks enable-addons --addon monitoring \ > --resource-group ${AZ_RESOURCE_GROUP?} --name ${AKS_CLUSTER?}

Verify

  1. Ensure the monitoring add-on is enabled in your AKS cluster. Verify that the output of the following command is true:

    root@rok-tools:~# az aks show --resource-group ${AZ_RESOURCE_GROUP?} \ > --name ${AKS_CLUSTER?} --query addonProfiles.omsagent.enabled true
  2. Ensure that the ama-logs DaemonSet is running in your AKS cluster. Verify that the number of DESIRED pods is equal to the number of READY pods:

    root@rok-tools:~# kubectl get ds ama-logs -n kube-system NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE ama-logs 5 5 5 5 5 <none> 28m

    Troubleshooting

    The DaemonSet was not found

    Depending on the region of your AKS cluster, the Azure Monitor DaemonSet may be deployed with a different name. In this case, the above command will fail with the following error:

    Error from server (NotFound): daemonsets.apps "ama-logs" not found

    In this case, retrieve the omsagent DaemonSet and perform the same verification:

    root@rok-tools:~# kubectl get ds omsagent -n kube-system NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE omsagent 5 5 5 5 5 <none> 28m
  3. Ensure that the ama-logs-rs Deployment is running in your AKS cluster. Verify that the READY field is equal to 1/1:

    root@rok-tools:~# kubectl get deployment ama-logs-rs -n kube-system NAME READY UP-TO-DATE AVAILABLE AGE ama-logs-rs 1/1 1 1 2d

    Troubleshooting

    The Deployment was not found

    Depending on the region of your AKS cluster, the Azure Monitor Deployment may be deployed with a different name. In this case, the above command will fail with the following error:

    Error from server (NotFound): deployments.apps "ama-logs-rs" not found

    In this case, retrieve the omsagent-rs Deployment and perform the same verification:

    root@rok-tools:~# kubectl get deployment omsagent-rs -n kube-system NAME READY UP-TO-DATE AVAILABLE AGE omsagent-rs 1/1 1 1 2d

Summary

You have successfully enabled Azure Monitor for your AKS cluster.

What’s Next

Check out the rest of the maintenance operations that you can perform on your cluster.