On Monday at Build Microsoft has announced a new monitoring solution Azure Monitor container health for AKS.
Azure Monitor container health is based on Azure Monitor, Azure Log Analytics and the Container Insights solution, and is integrated into the Azure portal experience.
As you may know there is also the container monitoring solution. I have written about it in this article.
You can continue to use the container monitoring solution, though the general recommendation is to use Azure Monitor container health for AKS and the container monitoring solution for Docker Swarm, DC/OS, OpenShift, ACS Engine-based clusters or other Docker-based installations like a single VM with Docker installed.
The Azure Monitor container health solution has a very clear panel to indicate resource consumption, operating and deployment issues. For deeper analysis you can directly jump into a log search on Log Analytics via View Logs.
As an example, I am showing the log output of a pod on my AKS cluster.
I can use the integrated log search in the Azure portal or for further query customization the Azure Log Analytics portal.
After setting the basics, let us talk about deploying the Azure Monitor container health solution.
The easiest part for new AKS clusters is to use the portal experience.
You only need to turn on “Enable container monitoring” and select a Log Analytics workspace or create a new one.
In the backend the AKS Resource Provider together with the Azure Resource Manager deploys the OMS agent daemonset on the AKS cluster under the kube-system namespace.
No need to have to do this afterwards as with the container monitoring solution.
The other alternative for new AKS clusters is using Azure Resource Manager templates. First use the following one to create an Azure Log Analytics workspace with the Container Insights solution.
az group deployment create --resource-group monitoring --template-uri https://raw.githubusercontent.com/neumanndaniel/armtemplates/master/operationsmanagement/aksMonitoringSolution.json --parameters workspaceName=aksMonitoring --verbose
Afterwards kick off the AKS deployment.
az group deployment create --resource-group aks --template-uri https://raw.githubusercontent.com/neumanndaniel/armtemplates/master/container/aks.json --parameters clusterName=aksCluster agentCount=3 agentVmSize=Standard_B2s linuxAdminUsername=azureuser sshRsaPublicKey=REDACTED servicePrincipalClientId=REDACTED servicePrincipalClientSecret=REDACTED kubernetesVersion=1.9.6 aksRegion=westeurope workspaceName=aksMonitoring workspaceResourceGroup=monitoring --verbose
When you have existing AKS clusters and you want to use the new monitoring solution, use the following ARM template to onboard them. Assuming you already have a Log Analytics workspace in place.
az group deployment create --resource-group aks --template-uri https://raw.githubusercontent.com/neumanndaniel/armtemplates/master/container/aksEnableMonitoring.json --parameters clusterName=aksCluster workspaceName=aksMonitoring workspaceResourceGroup=monitoring --verbose
Currently, you can only use the methods mentioned above for the Azure Monitor container health deployment.
For further details about Azure Monitor container health have a look at the Azure documentation.