Are you facing an error when logging into TKG v1.3.1 clusters integrated with Active Directory with an error “use of closed network connection” ? One of the reason could be the following and i faced this recently.
failed to login to the management cluster tkg-01, err-Failed to invoke API on cluster : Get "https://192.168.1.55:6443/version?timeout=1m0s": write tcp 22.214.171.124:3999->192.168.1.55:6443: use of closed network connection Error: exit status 1 :heavy_multiplication_x: exit status 1
Steps to Reproduce
- Login to management cluster or workload cluster using Active Directory Credential on the system without browser
- run the curl -L ‘URL returned from browser’ and run on linux system
- Other ssh session fails with an error
Detailed steps for login can be found here: Ref "https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/1.3/vmware-tanzu-kubernetes-grid-13/GUID-mgmt-clusters-configure-id-mgmt.html" and section Authenticate Users on a Machine Without a Browser
Reason for the Error
I have seen this issue is happening because of the time sync issue on the machine from where we are trying to login. Timezone need not to match between the machine you are trying to login to TKG cluster, but the time should be in sync with their respective timezone.
After syncing the time on the node from where you are trying to login, issue will be resolved.