Outbound calls from AKS intermittently fail with timeouts under load. Metrics show SNAT port usage at 100%.
AdvancedTroubleshootingNetwork Connectivity Errors
Answer
Likely causes → SNAT port exhaustion on the Standard LB outbound rule (default allocation per node is limited), especially with high connection churn to few destinations.
Diagnose → Load balancer metrics "SNAT Connection Count" with failed state, "Used SNAT Ports"; AKS diagnostics SNAT detector.
Fix →
- Switch to NAT Gateway outbound (
az aks update --outbound-type managedNATGatewaywhere supported) - Or increase outbound IPs/ports:
az aks update --load-balancer-managed-outbound-ip-count 4 --load-balancer-outbound-ports 4000 - Fix connection reuse in apps
Prevent → NAT Gateway by default for egress-heavy clusters.
More on Network Connectivity Errors
A VM with a public IP times out on SSH (`ssh: connect to host 20.x.x.x port 22: Connection timed out`).Beginner`nslookup kv-shop.vault.azure.net` from inside the VNet returns a public IP even though a Private Endpoint exists.IntermediateKey Vault returns `Client address is not authorized and caller is not a trusted service.` (ForbiddenByFirewall).BeginnerApplication Gateway returns `502 Bad Gateway` and backend health shows Unhealthy.IntermediateApp Gateway v2 deployment fails or goes unhealthy after a UDR `0.0.0.0/0 → firewall` was added to its subnet.AdvancedTwo VNets peered but VMs can't communicate; peering state shows `Initiated`.Intermediate