DEV Community

Abhishek Gupta for Microsoft Azure

Posted on

What is a Node resource group in Azure Kubernetes Service?

Here is a quick tip on Node Resource Group in Azure Kubernetes Service (AKS)

When you create an AKS cluster as part of an Azure resource group, all it contains is the AKS cluster and not the other AKS components such as nodes (virtual machines) etc. These resources related to your AKS cluster are a part of a different resource group which is automatically created during deployment - this is known as the Node Resource Group

This often trips up folks who are new to AKS since they try to look for components in the original resource group where AKS was deployed

In addition to the nodes, virtual network and other resources which are part of the AKS cluster when its initially deployed, the node resource group can also host additional components. For example, if you use a Persistent Volume claim with the default storage class, AKS will provision an Azure Disk, or, if you use a LoadBalancer service, AKS provisions an Azure Load Balancer behind the scenes.

The node resource group has a default naming convention, so it's not too hard to locate it. The format is - MC_<AKS resource group>_<AKS cluster name>_<AKS region> e.g. MC_mygroup_myaks_southeastasia. Say you wanted to list down the disks which back the Persistent Volumes in your AKS cluster, you can use the az disk list command in the Azure CLI along with the name of the node resource group:

export AKS_CLUSTER_NAME=myaks
export AKS_CLUSTER_REGION=southeastasia

Enter fullscreen mode Exit fullscreen mode

You can also choose to provide a custom name of your choice for the node resource group during the AKS cluster creation process. You can use the Azure CLI to query the name of this resource group using the az aks show command

AKS_NODE_RESOURCE_GROUP=$(az aks show --resource-group $AKS_CLUSTER_RESOURCE_GROUP --name $AKS_CLUSTER_NAME --query nodeResourceGroup -o tsv)
Enter fullscreen mode Exit fullscreen mode

Please note:

  • Don't (manually) add unrelated components to the node resource group since its lifecycle is tightly coupled with the lifecycle of the AKS cluster itself i.e. the node resource is automatically deleted as soon as the AKS cluster is deleted
  • Please do not modify the properties of the resources in the node resource group

Before wrapping up, have you checked out the Applied Cloud Stories initiative? It is an open call for technical content about relevant cloud scenarios and workloads, interesting challenges, and practical solutions that can run on Azure. You can participate by writing a new article, or recording a new video about the topic of your choice!

You can send in your stories before March 15, 2020 🙌 They will help inspire and educate engineers across the globe about how to approach advanced, innovative, and mission-critical cloud scenarios that are solving specific problems.

That's all for now. Stay tuned for more!

Top comments (0)