Tanzu Kubernetes Grid 1.2.1 CLI does not work when a Tanzu Kubernetes Grid management cluster is registered with Tanzu Mission Control
search cancel

Tanzu Kubernetes Grid 1.2.1 CLI does not work when a Tanzu Kubernetes Grid management cluster is registered with Tanzu Mission Control

book

Article ID: 319288

calendar_today

Updated On:

Products

Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid 1.x

Issue/Introduction

Symptoms:

Tanzu Kubernetes Grid (TKG) 1.2.1 CLI does not work when a TKGm  is registered with Tanzu Mission Control (TMC). The following are some symptoms you encounter when you face this issue:

  • The TKG CLI that has been previously working with management and workload clusters, stops working when you register your management cluster to TMC.
  • You see output similar to the following when you run the tkg get cluster command:

Error:: unable to retrieve combined cluster info: unable to get the list of clusters: unable to get TKC API Version: failed to get kubectl explain response for tkc resource: kubectl explain failed, output: the server doesn't have a resource type "tkc": exit status 1

  • You see output similar to the following when you run the tkg delete cluster tkg-workload-cluster command:
 Error: failed to get cluster object for delete: failed to get cluster object in namespace: 'default': no matches for kind "TanzuKubernetesCluster" in version "run.tanzu.vmware.com/v1alpha1"


Resolution

Upgrade the TKG CLI  to the latest version. In this case, you would upgrade TKG CLI 1.2.1 to TKG CLI 1.3.0 and validate the version.

Use the tanzu login command to change the context to any TKG cluster. You should see output similar to the following:

tanzu login --kubeconfig /root/.kube/config --context  tkg-mgmt-cluster-admin@tkg-mgmt-cluster   --name tkg-mgmt-cluster
✔  successfully logged in to management cluster using the kubeconfig tkg-mgmt-cluster


tanzu cluster list
NAME NAMESPACE STATUS CONTROLPLANE WORKERS KUBERNETES ROLES PLAN
tkg-workload-1 default running 1/1 1/1 v1.19.3+vmware.1 <none> dev tkg-workload-2 default running 3/3 3/3 v1.19.1+vmware.2 <none> prod