You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Configure Azure CNI networking for dynamic allocation of IPs and enhanced subnet support in Azure Kubernetes Service (AKS)
11
11
12
-
A drawback with the traditional CNI is the exhaustion of pod IP addresses as the AKS cluster grows, resulting in the need to rebuild the entire cluster in a bigger subnet. The new dynamic IP allocation capability in Azure CNI solves this problem by allocating pod IPs from a subnet separate from the subnet hosting the AKS cluster. It offers the following benefits:
12
+
A drawback with the traditional CNI is the exhaustion of pod IP addresses as the AKS cluster grows, which results in the need to rebuild your entire cluster in a bigger subnet. The new dynamic IP allocation capability in Azure CNI solves this problem by allocating pod IPs from a subnet separate from the subnet hosting the AKS cluster.
13
13
14
-
***Better IP utilization**: 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.
14
+
It offers the following benefits:
15
15
16
-
***Scalable and flexible**: Node and pod subnets can be scaled independently. A single pod subnet can be shared across multiple node pools of a cluster or across multiple AKS clusters deployed in the same VNet. You can also configure a separate pod subnet for a node pool.
17
-
18
-
***High performance**: Since pod are assigned VNet IPs, they have direct connectivity to other cluster pod and resources in the VNet. The solution supports very large clusters without any degradation in performance.
19
-
20
-
***Separate VNet policies for pods**: Since pods have a separate subnet, you can configure separate VNet policies for them that are different from node policies. This enables many useful scenarios such as allowing internet connectivity only for pods and not for nodes, fixing the source IP for pod in a node pool using a VNet Network NAT, and using NSGs to filter traffic between node pools.
21
-
22
-
***Kubernetes network policies**: Both the Azure Network Policies and Calico work with this new solution.
16
+
* **Better IP utilization**: 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.
17
+
* **Scalable and flexible**: Node and pod subnets can be scaled independently. A single pod subnet can be shared across multiple node pools of a cluster or across multiple AKS clusters deployed in the same VNet. You can also configure a separate pod subnet for a node pool.
18
+
* **High performance**: Since pod are assigned VNet IPs, they have direct connectivity to other cluster pod and resources in the VNet. The solution supports very large clusters without any degradation in performance.
19
+
* **Separate VNet policies for pods**: Since pods have a separate subnet, you can configure separate VNet policies for them that are different from node policies. This enables many useful scenarios such as allowing internet connectivity only for pods and not for nodes, fixing the source IP for pod in a node pool using a VNet Network NAT, and using NSGs to filter traffic between node pools.
20
+
* **Kubernetes network policies**: Both the Azure Network Policies and Calico work with this new solution.
23
21
24
22
This article shows you how to use Azure CNI networking for dynamic allocation of IPs and enhanced subnet support in AKS.
25
23
26
24
## Prerequisites
27
25
28
-
* The virtual network for the AKS cluster must allow outbound internet connectivity.
29
-
* AKS clusters may not use `169.254.0.0/16`, `172.30.0.0/16`, `172.31.0.0/16`, or `192.0.2.0/24` for the Kubernetes service address range, pod address range, or cluster virtual network address range.
30
-
* The cluster identity used by the AKS cluster must have at least [Network Contributor](../role-based-access-control/built-in-roles.md#network-contributor) permissions on the subnet within your virtual network. If you wish to define a [custom role](../role-based-access-control/custom-roles.md) instead of using the built-in Network Contributor role, the following permissions are required:
* The subnet assigned to the AKS node pool cannot be a [delegated subnet](../virtual-network/subnet-delegation-overview.md).
34
-
* AKS doesn't apply Network Security Groups (NSGs) to its subnet and will not modify any of the NSGs associated with that subnet. If you provide your own subnet and add NSGs associated with that subnet, you must ensure the security rules in the NSGs allow traffic within the node CIDR range. For more details, see [Network security groups][aks-network-nsg].
35
-
36
-
### Additional prerequisites
37
-
38
26
> [!NOTE]
39
-
> When using dynamic allocation of IPs, exposing an application as a Private Link Service using a Kubernetes Load Balancer Service is not supported.
40
-
41
-
The [prerequisites][prerequisites] already listed for Azure CNI still apply, but there are a few additional limitations:
27
+
> When using dynamic allocation of IPs, exposing an application as a Private Link Service using a Kubernetes Load Balancer Service isn't supported.
42
28
29
+
* Review the [prerequisites](/configure-azure-cni.md#prerequisites) for configuring basic Azure CNI networking in AKS, as the same prerequisites apply to this article.
30
+
* Review the [deployment parameters](/configure-azure-cni.md#deployment-parameters) for configuring basic Azure CNI networking in AKS, as the same parameters apply.
43
31
* Only linux node clusters and node pools are supported.
44
-
* AKS Engine and DIY clusters are not supported.
32
+
* AKS Engine and DIY clusters aren't supported.
45
33
* Azure CLI version `2.37.0` or later.
46
34
47
-
### Planning IP addressing
35
+
##Plan IP addressing
48
36
49
-
When using this feature, planning is much simpler. Since the nodes and pods scale independently, their address spaces can also be planned separately. Since pod subnets can be configured to the granularity of a node pool, customers can always add a new subnet when they add a node pool. The system pods in a cluster/node pool also receive IPs from the pod subnet, so this behavior needs to be accounted for.
37
+
Planning your IP addressing is much simpler with this feature. Since the nodes and pods scale independently, their address spaces can also be planned separately. Since pod subnets can be configured to the granularity of a node pool, you can always add a new subnet when you add a node pool. The system pods in a cluster/node pool also receive IPs from the pod subnet, so this behavior needs to be accounted for.
50
38
51
39
IPs are allocated to nodes in batches of 16. Pod subnet IP allocation should be planned with a minimum of 16 IPs per node in the cluster; nodes will request 16 IPs on startup and will request another batch of 16 any time there are <8 IPs unallocated in their allotment.
52
40
53
41
The planning of IPs for Kubernetes services and Docker bridge remain unchanged.
54
42
55
-
###Maximum pods per node in a cluster with dynamic allocation of IPs and enhanced subnet support
43
+
## Maximum pods per node in a cluster with dynamic allocation of IPs and enhanced subnet support
56
44
57
-
The pods per node values when using Azure CNI with dynamic allocation of IPs have changed slightly from the traditional CNI behavior:
45
+
The pods per node values when using Azure CNI with dynamic allocation of IPs slightly differ from the traditional CNI behavior:
58
46
59
47
|CNI|Default|Configurable at deployment|
60
48
|--| :--: |--|
@@ -63,74 +51,74 @@ The pods per node values when using Azure CNI with dynamic allocation of IPs hav
63
51
64
52
All other guidance related to configuring the maximum pods per node remains the same.
65
53
66
-
### Additional deployment parameters
54
+
##Deployment parameters
67
55
68
-
The deployment parameters described above are all still valid, with one exception:
56
+
The [deployment parameters](/configure-azure-cni.md#deployment-parameters) for configuring basic Azure CNI networking in AKS are all valid, with two exceptions:
69
57
70
58
* The **subnet** parameter now refers to the subnet related to the cluster's nodes.
71
59
* An additional parameter **pod subnet** is used to specify the subnet whose IP addresses will be dynamically allocated to pods.
72
60
73
-
###Configure networking - CLI with dynamic allocation of IPs and enhanced subnet support
61
+
## Configure networking with dynamic allocation of IPs and enhanced subnet support - Azure CLI
74
62
75
-
Using dynamic allocation of IPs and enhanced subnet support in your cluster is similar to the default method for configuring a cluster Azure CNI. The following example walks through creating a new virtual network with a subnet for nodes and a subnet for pods, and creating a cluster that uses Azure CNI with dynamic allocation of IPs and enhanced subnet support. Be sure to replace variables such as `$subscription` with your own values:
63
+
Using dynamic allocation of IPs and enhanced subnet support in your cluster is similar to the default method for configuring a cluster Azure CNI. The following example walks through creating a new virtual network with a subnet for nodes and a subnet for pods, and creating a cluster that uses Azure CNI with dynamic allocation of IPs and enhanced subnet support. Be sure to replace variables such as `$subscription` with your own values.
76
64
77
-
First, create the virtual network with two subnets:
65
+
Create the virtual network with two subnets.
78
66
79
-
```azurecli-interactive
80
-
resourceGroup="myResourceGroup"
81
-
vnet="myVirtualNetwork"
82
-
location="westcentralus"
67
+
```azurecli-interactive
68
+
resourceGroup="myResourceGroup"
69
+
vnet="myVirtualNetwork"
70
+
location="westcentralus"
83
71
84
-
# Create the resource group
85
-
az group create --name $resourceGroup --location $location
72
+
# Create the resource group
73
+
az group create --name $resourceGroup --location $location
When adding node pool, reference the node subnet using `--vnet-subnet-id` and the pod subnet using `--pod-subnet-id`. The following example creates two new subnets that are then referenced in the creation of a new node pool:
0 commit comments