AKS Networking

prasantc 751 Reputation points
2023-08-01T15:44:01.0566667+00:00

In AKS CNI networking, it looks like I need at least /23 to support the 6 nodes cluster. For service network I am planning to use another address space in the same vnet to avoid using /22 due to network limitations.

Does service network subnet has to be in the same vnet address space as pool subnet or I can assign separate /28 or /27 vnet for service subnet and create /27 or /28 subnet out of that address space or address prefix?

For pool I have created /23 vnet and assigned the entire /23 subnet to pool subnet.

For service I am planning to add additional address space in the same vnet and use that for service subnet. Or create separate vnet and create subnet under that vnet based on the recommendation.

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,779 questions
{count} votes

1 answer

Sort by: Most helpful
  1. mutaz-msft 2,256 Reputation points Microsoft Employee
    2023-08-02T10:08:59.3933333+00:00

    Hi prasantc,

    Let me answer you questions:
    1. In AKS CNI networking, it looks like I need at least /23 to support the 6 nodes cluster.
    This depends on the maxPods number since the pods will get IPs from the subnet, To calculate the minimum subnet size including an additional node for upgrade operations: (number of nodes + 1) + ((number of nodes + 1) * maximum pods per node that you configure)

    Reference: https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni#plan-ip-addressing-for-your-cluster

    2. Does service network subnet has to be in the same vnet address space as pool subnet or I can assign separate /28 or /27 vnet for service subnet and create /27 or /28 subnet out of that address space or address prefix?
    The service subnet must be in the same virtual network as your AKS cluster.
    Reference: https://learn.microsoft.com/en-us/azure/aks/internal-lb#specify-a-different-subnet

    3. For service I am planning to add additional address space in the same vnet and use that for service subnet. Or create separate vnet and create subnet under that vnet based on the recommendation.
    You can add additional address space in the same VNET and use a subnet in the same VNET; creating separated VNET is not supported.

    Also, you can consider this feature, Azure CNI networking for dynamic allocation of IPs; IPs are dynamically allocated to cluster Pods from the Pod subnet. This leads to better utilization of IPs in the cluster compared to the traditional CNI solution, which does static allocation of IPs for every node.
    Reference: https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni-dynamic-ip-allocation

    Or this feature, Azure CNI Overlay networking, With Azure CNI Overlay, the cluster nodes are deployed into an Azure Virtual Network (VNet) subnet. Pods are assigned IP addresses from a private CIDR logically different from the VNet hosting the nodes. Pod and node traffic within the cluster use an Overlay network. Network Address Translation (NAT) uses the node's IP address to reach resources outside the cluster.
    Reference: https://learn.microsoft.com/en-us/azure/aks/azure-cni-overlay

    Hope this helps, and please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.

    0 comments No comments