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 the Management Cluster to Amazon EC2 with the CLI
Deploy the Management Cluster to Amazon EC2 with the Installer Interface
Deploy the Management Cluster to vSphere with the CLI
Deploy the 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 Kubernetes Supervisor Cluster
Manage Multiple Management Clusters
tkg config cluster
--controlplane-machine-count
--kubernetes-version
--namespace
--plan
--worker-machine-count
Create Tanzu Kubernetes Cluster Configuration Files
tkg create cluster
--controlplane-machine-count Deploy a Cluster with a Highly Available Control Plane
--dry-run Preview the YAML for a Tanzu Kubernetes Cluster
--kubernetes-version Deploy a Cluster that Runs a Different Version of Kubernetes
--namespace Deploy a Cluster in a Specific Namespace
--plan Tanzu Kubernetes Cluster Plans
Deploy a Default Tanzu Kubernetes Cluster
--worker-machine-count Deploy a Cluster with Multiple Worker Nodes
tkg delete cluster Delete Tanzu Kubernetes Clusters
tkg delete management-cluster Delete Management Clusters
tkg get cluster Connect to and Examine Tanzu Kubernetes Clusters
tkg get credentials Connect to and Examine Tanzu Kubernetes Clusters
tkg get management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Examine the Management Cluster Deployment
Manage Multiple Management Clusters
tkg init
--infrastructure=aws Deploy the Management Cluster to Amazon EC2 with the CLI
--infrastructure=vsphere Deploy the Management Cluster to vSphere with the CLI
--name
--plan
Deploy the Management Cluster to vSphere with the CLI
Deploy the Management Cluster to Amazon EC2 with the CLI
--ui Deploy the Management Cluster to vSphere with the Installer Interface
Deploy the 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
Scale Tanzu Kubernetes Clusters
tkg set management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Manage Multiple Management Clusters
tkg version Set Up the Bootstrap Environment for Tanzu Kubernetes Grid

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 environment, that it uses to provision the final management cluster. This temporary cluster is removed after the deployment of the final management cluster to vSphere or Amazon EC2 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 environment 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 focus of kubectl to the context of 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 focus 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