Why another separate resource group created for AKS?

Uday Kiran Reddy (ureddy) 96 Reputation points
2021-09-17T13:45:25.357+00:00

Let's say I created a new aks cluster(newcluster) and kept in a resource group(newrg).
Then, another resource group also getting created with name MC_newrg_newcluster_eastus.

It contains below resources.

133145-image.png

Why it is created and the purpose of it?

Because of this, cluster can't be deleted directly.
We need to delete this rg first and then able to delete cluster.

Else, getting this error.

Similar to this.

133181-image.png

Azure Kubernetes Service
Azure Kubernetes Service

An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.

0 comments No comments

1 answer

Sort by: Newest
  1. TravisCragg-MSFT 5,701 Reputation points Microsoft Employee Moderator
    2021-09-18T00:28:59.63+00:00

    AKS creates this other resource group so that it can automatically create

    As stated from the AKS FAQ section about this extra resource group:

    The second resource group, known as the node resource group, contains all of the infrastructure resources associated with the cluster. These resources include the Kubernetes node VMs, virtual networking, and storage. By default, the node resource group has a name like MC_myResourceGroup_myAKSCluster_eastus. AKS automatically deletes the node resource group whenever the cluster is deleted, so it should only be used for resources that share the cluster's lifecycle.

    You can change the Resource Group name if you want, but AKS manages the resource group (and all resources within it). This allows AKS to create VMs, clusters, instances ect... for you. When you delete the AKS cluster, AKS SHOULD delete this resource group for you.

    In the error you listed, a NSG was added to the subnet that has a policy that AKS does not have permission to delete. This is why you had to delete that resource group manually. If you do not want to do this in the future, you can remove any policies on NSGs for AKS resource groups. Many orgs put these NSGs & policies on automatically.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.