`(InsufficientSubnetSize) Pre-allocated IPs 682 exceeds IPs available 251 in Subnet Cidr 10.20.1.0/24` when scaling or upgrading AKS.
IntermediateTroubleshootingAKS and ACR Errors
Answer
Likely causes → Flat Azure CNI reserves maxPods + 1 IPs per node including surge nodes, and the subnet is too small.
Diagnose → az aks nodepool show ... --query "{count:count, maxPods:maxPods, surge:upgradeSettings.maxSurge}"; compute (count + surge) × (maxPods + 1).
Fix →
- Lower max surge temporarily or use
--max-unavailable - Add a new pool on a new bigger subnet and migrate
- Long term: migrate to Azure CNI Overlay
Prevent → IP math during design; Overlay by default.
More on AKS and ACR Errors
Pods show `ImagePullBackOff` with `failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://acrshop.azurecr.io/oauth2/token?...: 401 Unauthorized`.Beginner`Failed to pull image "acrshop.azurecr.io/shop/web:v3": ... manifest unknown` or `not found`.Beginner`ImagePullBackOff` with `dial tcp: lookup acrshop.azurecr.io on 168.63.129.16:53: no such host` or connection timeouts to the registry.Advanced`exec /usr/local/bin/python: exec format error` in pod logs right after deploying a new image.BeginnerPods are `Pending`: `0/3 nodes are available: 3 Insufficient cpu. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod.`BeginnerCluster autoscaler events show `pod didn't trigger scale-up: 1 max node group size reached` or `NotTriggerScaleUp`.Intermediate