🔥 The FREE Azure Developer Guide eBook is available here (opens new window).
💡 Learn more : Azure Kubernetes Service (AKS) Diagnostics (opens new window).
📺 Watch the video : Learn how to use Azure Kubernetes Service Diagnostics (opens new window).
# Learn how to use Azure Kubernetes Service Diagnostics
# Diagnosing Kubernetes
Azure Kubernetes Service (AKS) (opens new window) enables you to run multiple containers and orchestrate them by scaling them, securing them and tying them together. A solution that runs inside a Kubernetes cluster can quickly become complex. This makes it more difficult to pinpoint issues and resolve them quickly.
The Diagnostics overview (opens new window) in Azure Kubernetes Service can help you to identify, diagnose and resolve issues in your Kubernetes cluster. In this post, we'll take a look at what the Diagnostics overview can do for us.
If you want to follow along, you'll need the following:
- An Azure subscription (If you don't have an Azure subscription, create a free account (opens new window) before you begin)
- A running Azure Kubernetes Service (AKS) cluster that runs an application in one or more nodes. You can set one up by following this walkthrough. (opens new window)
- The Azure CLI (opens new window). You can download it for Windows, Linux or Mac (opens new window). Or you can use the Azure Cloud Shell (opens new window)
# Using Azure Kubernetes Service Diagnostics
Let's try it out. I have a Kubernetes cluster running in Azure that is running a sample application. I've deployed it by following the steps in this walkthrough. (opens new window)
(Check AKS service endpoints)
But when I try to open the azure-vote-front service in a browser, it doesn't work and shows an error.
(Service doesn't work and shows an error)
Let's find out why this isn't working.
- Go to the Azure portal (opens new window)
- Open the Azure Kubernetes Service cluster
- Navigate to the Diagnose and solve problems menu
(Diagnose and solve problems menu in AKS)
Here, you can search for keywords, like "Failures", or describe the problem. Click on the search textbox to see some examples of what you can search for and diagnose. You can see the entire list of issues that can be diagnosed here (opens new window). Let's click on Failures to see if we can find out what went wrong. This shows that there are issues with one or more Nodes. Click on the issues to drill down into them. In my case, the issue is that my Node has been powered off and it needs to be restarted.
(Node issues in the Diagnose and resolve problems feature)
I need to upgrade my cluster anyways, so I'll do just that. This will automatically restart my nodes as well and probably solve the issue. I upgrade my cluster by navigating to the Upgrade menu, selecting the latest version and saving the changes. This takes a while.
(Upgrade cluster restarts nodes)
When my cluster is upgraded, my nodes are restarted. Let's try to use the service again in the browser. The application loads successfully.
(Service works after node restart)
Diagnosing issues in Azure Kubernetes Service (AKS) (opens new window) is now a lot easier with Azure Kubernetes Service (AKS) Diagnostics (opens new window). You can ask the intelligent diagnostics feature what you want it to investigate and it will tell you if anything is wrong and what the issues are and how to resolve them. Go and check it out!