How to increase subnet size to solve "insufficient Subnet Size" for aks system subnet while upgrading

Ziad El-Gendy 20 Reputation points
2024-06-25T11:46:32.2+00:00

Hello,

We have an AKS cluster configured with the AzureCNI plugin for networking, which means that the pods take IP addresses from the subnet. Currently, there are only 9 IP addresses available, preventing us from updating the cluster.
User's image

To resolve this, we need to change the subnet mask from /26 to /24 while keeping the same subnet address.

Is there any method to achieve this without disrupting the existing setup? Any guidance or best practices for performing this change would be greatly appreciated.

Thank you!

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,950 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jackson Martins 10,126 Reputation points MVP
    2024-06-25T13:07:47.56+00:00

    Hi @Ziad El-Gendy

    You can create a new subnet with the desired subnet mask (for example, /24) within the same virtual network (VNet).

    Update the AKS cluster to use the new subnet for node pools. This can be done by creating new node pools in the new subnet and gradually migrating workloads to these new node pools.

    Make sure you have enough capacity to run your workloads during this migration.

    Gradually drain and isolate nodes on the old subnet and move workloads to nodes on the new subnet.

    Use the kubectl drain command to safely remove all pods from a node.

    Update the cluster configuration:

    After all workloads are migrated, update the cluster configuration to point to the new subnet.

    You can Also reduce the cluster nodes to reserve IP addresses for the upgrade.

    If scaling down isn't an option, and your virtual network CIDR has enough IP addresses, try to add a node pool that has a unique subnet:

    1. Add a new user node pool in the virtual network on a larger subnet.
    2. Switch the original node pool to a system node pool type.
    3. Scale up the user node pool.
    4. Scale down the original node pool.

    Reference: https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/create-upgrade-delete/error-code-subnetisfull-upgrade

    https://learn.microsoft.com/en-us/azure/aks/scale-cluster?tabs=azure-cli

    https://learn.microsoft.com/pt-br/azure/aks/configure-azure-cni?tabs=configure-networking-portal

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--


0 additional answers

Sort by: Most helpful