DEV Community

Michael Crump for Microsoft Azure

Posted on

Learn how to use Azure Kubernetes Service Diagnostics

Azure Kubernetes Service (AKS) 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 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.

Prerequisites

If you want to follow along, you'll need the following:

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.

It should be ready to go. It has a frontend node and I can check how to reach it with the Azure CLI (or Azure Cloud Shell) with the kubectl get service command.

Alt Text

(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.

Alt Text

(Service doesn't work and shows an error)

Let's find out why this isn't working.

  1. Go to the Azure portal
  2. Open the Azure Kubernetes Service cluster
  3. Navigate to the Diagnose and solve problems menu

Alt Text

(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. 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.

Alt Text

(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.

Alt Text

(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.

Alt Text

(Service works after node restart)

Conclusion

Diagnosing issues in Azure Kubernetes Service (AKS) is now a lot easier with Azure Kubernetes Service (AKS) Diagnostics. 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.

Stay connected with me on various social platforms for daily software development news.

Top comments (0)