This article is written to give you a high level insight into the possibilities of monitoring (Azure) resources, but AKS cluster in particular. The tools described in this article are just the tip of the iceberg. There are so many tools in the market to monitor resources and the possibilities are endless. Setting up monitoring takes time and effort. It is best to include the implementation of monitoring in the design or development of your application and to continuously refine and improve it in your DevOps process.
Why should we monitor at all?
Suppose you have built a web shop application and divided it into different microservices (small pieces of processes), such as a microservice to place items on an order, a checkout process to place the order and a payment process so that your customers can pay for the items. Each microservice of this application is pivotal in the proper functioning of your web shop. But what if one of these microservices fails in your application and you don't realize it? Your company will lose customers because of this, because they will order elsewhere. And because your web shop is not available, you lose money to the competitor.
So that’s why monitoring can help you. Monitoring tells you something about the availability of your application, the health of your infrastructure, about how your applications perform and eventually the health of your business.
Before you start
If you have followed this article “Azure Kubernetes cluster set up” you should now have your first Azure Kubernetes Service cluster, further referred as AKS, up and running and probably have one or more applications running on it. Very good and well done! But what should be the next logical step for your AKS environment? I have a suggestion for you: Monitoring and a bit of management.
So let’s start with the basics. For this we need to install three command-line tools.
- az cli: The Azure CLI is a set of commands used to create and manage resources. You can download it here and it is available for Windows, Linux, and macOS environments.
- kubectl: This is the command-line tool to control and manage your AKS environment. You can download this tool from here and it is also available for macOS, Linux, and Windows environments.
- helm: Helps you manage Kubernetes applications. Helm Charts help you define, install, and upgrade even the most complex Kubernetes applications. You can download Helm from here and it is available for Linux, Windows, and macOS.
Azure Monitor
Azure Monitor maximizes the availability and performance of your applications and services by delivering a comprehensive solution for collecting, analyzing, and acting on telemetry from your cloud and on-premises environments.
Alternatively, it is possible to create your own workbooks based on your monitoring requirements.
In this pane, you can further select Cluster Performance, Disk IO and Capacity, and Network.
Another way to get there and see more about the health of your AKS Cluster is to navigate in the Azure portal to Kubernetes Service -> SelectYourCluster -> Insights.
Give it a try and navigate around. Make sure you don’t miss the “View Workbooks” dropdown.
To drill further down into your application, consider installing a small instrumentation package (SDK) into your application. You can read all about it at this location.
Prometheus and Grafana
A combination that is often used is Prometheus and Grafana. Prometheus is a time-series database or metric server, and Grafana is used to visualize metrics from different data sources, including Prometheus.
You can find a large community developing dashboards for Grafana. You can browse them at this location and read here how to import dashboards into Grafana.
Management with kubectl
To manage your AKS cluster, you will have to work with the command-line tool kubectl. However, you can also manage resources through the Azure portal. Please note that this functionality is still in preview and shouldn’t be used in a production environment.
If you want to start or get familiar with kubectl, check out the kubectl quick reference.
One last word ...
If you managed to read this article to its end, then you should have a good basis to start monitoring your AKS cluster. The bottom line is that if you want your applications to remain available, you need monitoring!
Intercept wishes you good luck with implementing monitoring, and if you have any questions, feel free to contact us.
This article is part of a series
This is the last article of the series. Want to read previous articles? Check here:
1. The evolution of AKS
2. Hybrid deployments with Kubernetes
3. Microservices on AKS
4. Update scenarios on AKS
5. Linux vs. Windows containers
Sign up here for our Intercept Insights and we’ll keep you updated with the latest articles.