Hi Orestis Gklavas,
Switching to IPVS improves performance, but it also changes how traffic is routed, which can cause issues with IMDS access. Since AAD Pod Identity relies on NMI pods reaching IMDS (169.254.169.254), you’ll need to make sure this traffic isn’t affected by IPVS rules.
1.Exclude IMDS from kube-proxy rules
Since AKS doesn’t use a ConfigMap for kube-proxy, you’ll need to set excludeCIDRs during cluster updates. You can try:
az aks update \
--resource-group <your-resource-group> \
--name <your-cluster-name> \
--kube-proxy-config '{"mode":"ipvs","excludeCIDRs":["169.254.169.254/32"]}'
However, this might not always work as expected in AKS.
- Manually adjust iptables on nodes If the above doesn’t work, you can manually add an iptables rule to ensure traffic to IMDS is handled properly:
iptables -t nat -A PREROUTING -d 169.254.169.254/32 -j RETURN
This should allow traffic to bypass IPVS.
3.Run NMI pods with hostNetwork: true
Modifying the NMI deployment to use hostNetwork: true can help, as it allows the pods to bypass kube-proxy and communicate directly with IMDS.
Please refer the below documents:
https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=windows
https://learn.microsoft.com/en-us/azure/aks/imds-restriction
If the comment was helpful, please don't forget to click "Upvote".
If you have any further queries, please let us know we are glad to help you.
Thank You.