An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
Dynamic pod IP allocation (Azure CNI Pod Subnet - Dynamic IP Allocation) and static block allocation (Azure CNI Pod Subnet - Static Block Allocation) both require that all agent pools in a cluster follow the same CNI mode and that pod subnet usage is consistent across pools.
From the documented behavior:
- Only one CNI type can be used per cluster: traditional Azure CNI vs Azure CNI Pod Subnet (dynamic or static). Mixed CNI modes in the same cluster are not supported.
- For Azure CNI Pod Subnet modes, only a single pod subnet can be assigned to a given node pool, but multiple node pools or clusters can share that same pod subnet.
- Static Block vs Dynamic IP allocation is controlled per node pool via
--pod-ip-allocation-mode, but a single subnet cannot be used in both modes at the same time. - For static block allocation, migration or updating existing node pools in-place is explicitly not supported; only adding new node pools with a different subnet is supported.
The error All or none of the agentpools should set podsubnet is consistent with the requirement that the cluster’s agent pools be configured consistently with respect to pod subnet usage. In practice this means there is no supported partial/gradual enablement of Azure CNI Pod Subnet on only some pools while others remain without a pod subnet.
The documented migration pattern is:
- Create a new subnet in the existing VNet dedicated to the new mode (for example, Static Block Allocation) and size it according to the IP planning guidance.
- Add a new agent pool to the existing cluster that uses the new pod subnet and the desired allocation mode (
DynamicIndividualfor dynamic,StaticBlockfor static), referencing:-
--vnet-subnet-idfor the node subnet -
--pod-subnet-idfor the pod subnet -
--pod-ip-allocation-modefor the allocation mode
-
- Cordon and drain workloads from the old node pools to the new node pool.
- Once all workloads are moved and stable, delete the old node pools.
Important constraints from the documentation:
- For Static Block Allocation, migration or updating existing clusters or node pools is not supported; only adding new node pools with a different subnet is supported. This implies that the safe path is to:
- Add new node pools using the new pod subnet and allocation mode.
- Move workloads.
- Remove the old pools.
- Only a single mode of operation can be used per subnet. If a subnet uses Static Block allocation, it cannot use Dynamic IP allocation in a different cluster or node pool with the same subnet and vice versa.
Given these constraints, a safe migration path is limited to the documented pattern of adding new node pools with the new pod subnet and allocation mode, then draining and deleting the old pools. In-place modification of existing pools to add pod subnets or to mix pools with and without pod subnets in the same cluster is not supported.
References: