You can manage TKG clusters using custom kubectl commands. These commands are made available by custom resources managed by the TKG Controller.

Custom Commands to Manage TKG Clusters

The table lists and describes kubectl commands for managing TKG clusters.

Run each command from the context for the vSphere Namespace where the TKG cluster is provisioned. Running these commands in the cluster context returns no information.

Table 1. Custom Commands to Manage TKG Clusters
Command Description
kubectl get tanzukubernetescluster
Lists the TKCs in the current namespace.
kubectl get tkc
Short form version of the preceding command.
kubectl get cluster
Returns Clusters in the namesapce.
kubectl describe tanzukubernetescluster CLUSTER-NAME
Describe the specified cluster, showing the expressed state, status, and events. When provisioning is complete, this command shows the virtual IP created for the load balancer that fronts Kubernetes API endpoints.
kubectl get cluster-api
Lists the Cluster API resources supporting the clusters in the current namespace, including resources from the Cluster API project and from the Cluster API Provider used by the Tanzu Kubernetes Grid Service.
kubectl get tanzukubernetesreleases
List available Tanzu Kubernetes releases.
kubectl get tkr
Short form version of the preceding command.
kubectl get tkr v1.23.8---vmware.1-tkg.1.5417466 -o yaml
Provides details on the named Tanzu Kubernetes release.
kubectl get virtualmachine
Lists the virtual machine resources supporting the cluster nodes in the current namespace.
kubectl get vm
Short form version of the preceding command.
kubectl describe virtualmachine VIRTUAL-MACHINE-NAME
Describe the specified virtual machine, showing the state, current status, and events.
kubectl describe virtualmachinesetresourcepolicy
List the Virtual Machine Set Resource Policy resources supporting the cluster in the current namespace. This resource represents the vSphere objects resource pool and folder used for the cluster.
kubectl get virtualmachineservice
Lists the Virtual Machine Service resources supporting the cluster nodes in the current namespace. These resources are analogous to a service, but for virtual machines instead of pods. Virtual machine services are used both for providing a load balancer for the control plane nodes of a cluster and by the paravirtual cloud provider to support a Kubernetes Service of type LoadBalancer within a cluster.
kubectl get vmservice
Short form version of the preceding command.
kubectl describe virtualmachineservice VIRTUAL-MACHINE-SERVICE-NAME
Describe the specified Virtual Machine Service, showing the expressed cluster state, current status, and events.
kubectl get virtualmachineimage
List available virtual machine images.
kubectl get vmimage
Short cut version of the preceding command.
kubectl describe vmimage VM_IMAGE_NAME
View details on the named VM image.
kubectl get virtualnetwork
Lists the virtual network resources in the current namespace, including resources used for clusters. A virtual network is created for each namespace where a cluster is provisioned, and for each cluster itself.
kubectl get persistentvolumeclaim
Lists the persistent volume claim resources in the current namespace, including resources used for clusters.
kubectl get cnsnodevmattachment
Lists the CNS node virtual machine attachment resources in the current namespace. These resources represent the attachment of a persistent volume managed by CNS to a virtual machine serving as the node of a cluster.
kubectl get configmap
Lists the configuration maps in the current namespace, including maps used for the creation of cluster nodes. Configuration maps are not intended to be user-modifiable, and any changes are overwritten.
kubectl get secret
Lists the secrets in the current namespace, including secrets used for the creation and management of cluster nodes.