After renewing vCenter machine certificates, there is a problem connecting to a Kubernetes guest cluster.
The following error is received from the jumpbox when trying to gain access to the guest cluster.
<user>@tanzu-virtual-machine:/tmp$ kubectl get nodeserror: You must be logged in to the server (the server has asked for the client to provide credentials)
Running the same command with trace option.
<user>@tanzu-virtual-machine:/tmp$ kubectl get nodes -v 10{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}E0613 09:19:04.332631 3236672 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentialsI0613 09:19:04.332698 3236672 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentialsI0613 09:19:04.332877 3236672 helpers.go:246] server response object: [{"metadata": {},"status": "Failure","message": "the server has asked for the client to provide credentials","reason": "Unauthorized","details": {"causes": [{"reason": "UnexpectedServerResponse","message": "unknown"}]},"code": 401}]error: You must be logged in to the server (the server has asked for the client to provide credentials)After renewing vCenter machine certificates , the guest-cluster-auth pods retain the old certificates' thumbprint until they are restarted.
This will be fixed in future releases of the guest cluster.
To workaround this, restart the Guest Cluster authentication pods in the Guest Cluster:
export KUBECONFIG=/etc/kubernetes/admin.confkubectl get pods -A | grep cluster-auth -w
kubectl delete pod -n vmware-system-auth guest-cluster-auth-svc-xxxxkubectl get pods -A | grep cluster-auth -w