When running tanzu mission-control cluster admin-kubeconfig get <CLUSTER_NAME> -p <PROVISIONER_NAME> -m <MANAGEMENT_CLUSTER_NAME>, users might see the following errors returned:
Scenario 1:
Error: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Scenario 2:
Error: rpc error: code = NotFound desc = (target=mc:<id>, intentId=<id>): AdminKubeconfig.run.tanzu.vmware.com "<>" not found
2025-01-07 00:47:00 - Retrieving kubeconfig for cluster: <cluster>
Cluster admin kubeconfig for <cluster>:
HTTP/1.1 404 Not Found
vSphere with Tanzu Supervisor Cluster managed by Tanzu Mission Control SaaS.
This problem is caused when the Supervisor Cluster is unreachable, or when certain TMC pods on the Supervisor Cluster are degraded.
Scenario 1:
Restart the TMC intent-agent pod on the Supervisor Cluster. If this doesn't resolve the issue, follow the steps in the Additional Information field to gather more verbose messaging on the failure.
Scenario 2:
Restart the TMC sync-agent and vsphere-resource-retriever pods on the Supervisor Cluster. The vsphere-resource-retriever generates the adminkubeconfig and then sync-agent sents it back to TMC.
Use the script attached to this KB to send a curl request to the TMC API for more verbose messaging on the failure.
export VMW_CLOUD_API_TOKEN=<YOUR_API_TOKEN>
management_cluster="MANAGEMENT_CLUSTER_NAME" # Replace with your management cluster name
provisioner="GUEST_CLUSTER_NAMESPACE" # Replace with your provisioner name
cluster_name="GUEST_CLUSTER_NAME" # Replace with your cluster name
api_host="https://<API_HOST>.tmc.cloud.vmware.com" # Replace if your API host is different
chmod +x <SCRIPT_NAME>