If it's any use to others, I had the same issue. Reducing the number of nodes in my cluster from 5 to 4 allowed me to do the upgrade. AKS needs to create an additional node temporarily while upgrading, and if there aren't enough IPs available for that it will fail. Reducing the number of nodes gives it space.
Upgrade Azure Kubernetes Cluster from 1.19.7 to 1.20.13
I am having an issue when trying to upgrade my Kubernetes Cluster hosted on Azure from 1.19.7 to 1.20.13.
Whenever I try to complete the upgrade I get the following error message:
(InsufficientSubnetSize) Pre-allocated IPs 124 exceeds IPs available 123 in Subnet Cidr XX.XXX.X.X/25
I tried to scale down the amount of pods (from 30 per node to 20) per node to free up some extra IP addresses to allow the upgrade to occur, but I couldn't reduce this number. From investigation I see that this number can't be changed after creation(Is that correct?)
Can anyone help provide guidance on what to do in this scenario?
Thanks
Azure Kubernetes Service
2 answers
Sort by: Most helpful
-
-
shiva patpi 13,366 Reputation points Microsoft Employee Moderator
2022-01-12T05:56:10.753+00:00 Hello @Max Remacle ,
Correct! Max Pod per node setting can be defined only at the time of new node pool creation - it can't be changed later on.Reason for the error is because of this: - https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni#plan-ip-addressing-for-your-cluster
Basically, you cannot modify a subnet if it has any resources using the subnet and you cannot scale the cluster down if it is in a failed state due to an upgrade and also you cannot change the subnet of an existing cluster.
But you can change the subnet of a node
Can move your nodes to another subnet in the same VNET, and maintain connectivity
You can try to delete a node and not affect the running pods, if there is enough space for the pods on the nodes that remainNavigate to the VMSS in the portal then click on Scaling. Then scale the VMSS manually down by at least 1 instance:
This will update the node count in the nodepool and reduce the amount of IP's used and the upgrade can be completed