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.
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 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.
- The Azure CLI. You can download it for Windows, Linux or Mac. Or you can use the Azure Cloud Shell
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.
(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
- 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. 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) 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.
Posted on Jun 12 by: