The table below lists all of the commands and options of the Tanzu Kubernetes Grid CLI, and provides links to the section in which they are documented.

Command Options Documented In
tkg *
--config Common Tanzu Kubernetes Grid Options
Deploy a Management Cluster to Amazon EC2 with the CLI
Deploy a Management Cluster to Amazon EC2 with the Installer Interface
Deploy a Management Cluster to Microsoft Azure with the CLI
Deploy a Management Cluster to Microsoft Azure with the Installer Interface
Deploy a Management Cluster to vSphere with the CLI
Deploy a Management Cluster to vSphere with the Installer Interface
--kubeconfig
--log_file
--quiet
--v
Common Tanzu Kubernetes Grid Options
tkg add management-cluster Use the Tanzu Kubernetes Grid CLI with a vSphere with Tanzu Supervisor Cluster
Manage Your Management Clusters
tkg config cluster
--controlplane-machine-count
--controlplane-size
--enable-cluster-options autoscaler
--enable-cluster-options oidc
--haproxy-size
--kubernetes-version
--namespace
--plan
--size
--worker-machine-count
--worker-size
Create Tanzu Kubernetes Cluster Configuration Files
tkg config permissions aws
--config
--kubeconfig
--log_file
--quiet
--v
Deploy Management Clusters to Amazon EC2 with the CLI
tkg create cluster
--cni Deploy a Cluster with a Non-Default CNI
--controlplane-machine-count Deploy a Cluster with a Highly Available Control Plane
--controlplane-size Deploy a Cluster with Nodes of Different Sizes
--dry-run Preview the YAML for a Tanzu Kubernetes Cluster
--enable-cluster-options autoscaler Deploy a Cluster with Cluster Autoscaler Enabled
Scale Worker Nodes with Cluster Autoscaler
--enable-cluster-options oidc Deploy an Authentication-Enabled Tanzu Kubernetes Cluster
Create Tanzu Kubernetes Clusters
--kubernetes-version Deploy a Cluster that Runs a Different Version of Kubernetes
--manifest Create Tanzu Kubernetes Cluster Configuration Files
Preview the YAML for a Tanzu Kubernetes Cluster
--namespace Deploy a Cluster in a Specific Namespace
--plan Tanzu Kubernetes Cluster Plans
Deploy a Default Tanzu Kubernetes Cluster
--size Deploy a Cluster with Nodes of Different Sizes
--vsphere-controlplane-endpoint Deploy Tanzu Kubernetes Clusters
--worker-machine-count Deploy a Cluster with Multiple Worker Nodes
--worker-size Deploy a Cluster with Nodes of Different Sizes
tkg delete cluster Delete Tanzu Kubernetes Clusters
tkg delete machinehealthcheck Configure Machine Health Checks for Tanzu Kubernetes Clusters
tkg delete management-cluster Delete Management Clusters
tkg get ceip-participation Opt in or Out of the VMware CEIP
tkg get cluster
--include-management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Upgrade Management Clusters
Upgrade Tanzu Kubernetes Clusters
--namespace
--output
Connect to and Examine Tanzu Kubernetes Clusters
tkg get credentials
--export-file
--namespace
Connect to and Examine Tanzu Kubernetes Clusters
tkg get kubernetesversions Deploy a Cluster that Runs a Different Version of Kubernetes
Upgrade Tanzu Kubernetes Clusters
tkg get machinehealthcheck Configure Machine Health Checks for Tanzu Kubernetes Clusters
tkg get management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Examine the Management Cluster Deployment
Manage Your Management Clusters
Upgrade Management Clusters

  --name
--output
Manage Your Management Clusters
tkg init
--infrastructure aws Deploy a Management Cluster to Amazon EC2 with the CLI
--infrastructure azure Deploy a Management Cluster to Microsoft Azure with the CLI
--deploy-tkg-on-vSphere7
--enable-tkgs-on-vSphere7
--infrastructure vsphere
--vsphere-controlplane-endpoint
Deploy a Management Cluster to vSphere with the CLI
--ceip-participation
--controlplane-size
--name
--plan
--size
--worker-size
Deploy a Management Cluster to vSphere with the CLI
Deploy a Management Cluster to Amazon EC2 with the CLI
Deploy a Management Cluster to Microsoft Azure with the CLI
--ui
--ui --bind
--ui --browser
Deploy a Management Cluster to vSphere with the Installer Interface
Deploy a Management Cluster to Microsoft Azure with the Installer Interface
Deploy a Management Cluster to Amazon EC2 with the Installer Interface
--use-existing-bootstrap-cluster See below
tkg scale cluster
--controlplane-machine-count
--namespace
--worker-machine-count
Manage Your Management Clusters
Scale Tanzu Kubernetes Clusters
tkg set ceip-participation Opt in or Out of the VMware CEIP
tkg set machinehealthcheck Configure Machine Health Checks for Tanzu Kubernetes Clusters
tkg set management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Manage Your Management Clusters
tkg upgrade cluster
--kubernetes-version
--namespace
--timeout
--vpshere-vm-template-name
--yes
Upgrade Tanzu Kubernetes Clusters
tkg upgrade management-cluster
--timeout
--vpshere-vm-template-name
--yes
Upgrade Management Clusters
tkg version Install the Tanzu Kubernetes Grid CLI

Use an Existing Bootstrap Cluster

By default, when you deploy a management cluster by running tkg init, Tanzu Kubernetes Grid creates a temporary kind cluster on the bootstrap machine, that it uses to provision the final management cluster. This temporary cluster is removed after the deployment of the final management cluster to vSphere, Amazon EC2, or Azure completes successfully. The same process of creating a temporary kind cluster also applies when you run tkg delete management-cluster to remove a management cluster.

In some circumstances, it might be desirable to keep the local bootstrap cluster after deploying or deleting a management cluster. For example, you might want to examine the objects in the cluster or review its logs. In this case, you can skip the creation of the kind cluster and use any Kubernetes cluster that already exists on your bootstrap machine as the local bootstrap cluster.

IMPORTANT:

  • Using an existing bootstrap cluster is an advanced use case that is for experienced Kubernetes users. It is strongly recommended to use the default kind cluster that Tanzu Kubernetes Grid provides to bootstrap your management clusters.
  • If you have used an existing cluster to bootstrap a management cluster, you cannot use that same cluster to bootstrap another management cluster. The same applies to deleting management clusters.

Procedure

  1. Set the context of kubectl to the local Kubernetes cluster that you want to use as a bootstrap cluster.

    kubectl config use-context my-bootstrap-cluster-admin@my-bootstrap-cluster
    
  2. To create a management cluster, run the tkg init command and specify the --use-existing-bootstrap-cluster option.

    tkg init --infrastructure=vsphere --use-existing-bootstrap-cluster my-bootstrap-cluster
    
  3. To delete a management cluster, run the tkg delete management-cluster command and specify the --use-existing-bootstrap-cluster option.

    If you are deleting a management cluster, first run tkg get management-cluster and tkg set management-cluster to make sure that the context of the Tanzu Kubernetes Grid CLI is set to the management cluster to delete.

    tkg delete management-cluster --use-existing-bootstrap-cluster my-bootstrap-cluster
    
check-circle-line exclamation-circle-line close-line
Scroll to top icon