Users experience intermittent connection timeouts when attempting to authenticate to a vSphere Kubernetes Service (VKS) cluster using the `kubectl vsphere login` command. The issue typically occurs when the connection is routed through an Avi (NSX Advanced Load Balancer) Service Engine.
Executing the login command with verbosity (`-v 10`) shows the following:
`Trying to login to <Avi_VIP>`
`WARN Error occurred during HTTP request: Post "https://<Avi_VIP>/wcp/login": net/http: TLS handshake timeout`
VMware Kubernetes Supervisor(VKS)
Avi Load Balancer
This issue is caused by **asymmetric routing** triggered when the **"Preserve Client IP"** feature is enabled in the Avi L4 Application Profile.
When this feature is enabled:
To resolve the login timeouts, disable the "Preserve Client IP" feature on the affected Virtual Service to ensure symmetric routing via SNAT.
Here is a step to disable "Preserve Client IP".