Description
What happened:
cloud-provider-azure/pkg/provider/azure_storageaccount.go
Lines 365 to 375 in 3e88183
This piece of code assumes that all virtual networks have a name with the '-vnetlink' suffix.
If this is not the case it will try to create the vnetlink, but if a different link already exists for the same vnet. It will fail.
What you expected to happen:
The code should get all virtualnetworklinks and check if one already exists for that vnet (preferably with the Resource ID of the vNet). If it exists, it should not try to create a new virtualnetworklink as only one can exist per vnet.
How to reproduce it (as minimally and precisely as possible):
We hit this issue while upgrading from AKS 1.27 --> 1.28. This also upgrades the CSI drivers, which use this provider. Initially you notice no issues, but when you try to do any actions on your PVC it will report in the logs with errors about not being able to create the virtualnetworklink.
Anything else we need to know?:
The workaround is to manually delete the vnetlink and recreate it with the '-vnetlink' suffix, however that causes a temporary failure in name resolution (depending on TTL of records)
Environment:
- Kubernetes version (use
kubectl version
): happened after upgrading from AKS 1.27 --> 1.28.9 - Cloud provider or hardware configuration: Azure AKS
- OS (e.g:
cat /etc/os-release
): Ubuntu - Kernel (e.g.
uname -a
): - - Install tools: -
- Network plugin and version (if this is a network-related bug):-
- Others: