Unable to collect the support bundle successfully\nerror using Supervisor cluster kubeconfig: cannot access cluster <cluster-name> in namespace <namespace>: the server could not find the requested resource\n"
kubectl vsphere login --server=<vCenter server IP> --vsphere-username <user ID> --tanzu-kubernetes-cluster-name <name of the cluster> --tanzu-kubernetes-cluster-namespace <supervisor namespace where the guest cluster is deployed> --insecure-skip-tls-verifyvSphere Kubernetes Service
When a user runs the "kubectl vSphere login" command as mentioned in the introduction section, by default the current context is set to the Guest Cluster name. However, the VKS bundler expects you to be inside the context that gets created explicitly with the supervisor IP address. As a result, it cannot locate the cluster within the namespace specified.
Switch to the supervisor IP Address context to extract the support bundle. Refer the below example on how to do the same.
kubectl vsphere login --server=<vCenter server IP> --vsphere-username <user ID> --tanzu-kubernetes-cluster-name dummy-cluster --tanzu-kubernetes-cluster-namespace dummy-cluster-ns --insecure-skip-tls-verify
Password:
Logged in successfully.
You have access to the following contexts:
10.#.#.# <------ This is the IP Address of the supervisor FIP.
dummy-cluster-ns
dummy-cluster
[]$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
10.#.#.# 10.#.#.# wcp:<IP>:<username>
dummy-cluster-ns <IP-Address> wcp:<IP>:<username> dummy-cluster-ns
* dummy-cluster 192.#.#.# wcp:<IP>:<username>
[~]$ kubectl config use-context 10.#.#.#[~]$ kubectl config get-context
Now use the vks-support-bundler to extract the support bundle and you should be able to complete the same without issues.
Extract VKS support bundle- Gathering Logs for vSphere with Tanzu
More information on "kubectl vSphere login" can be found here- https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere-supervisor/7-0/connect-to-a-tkg-service-cluster-as-a-vcenter-single-sign-on-user-with-kubectl.html