Tanzu CLI Command Reference

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

To install the Tanzu CLI, see Install the Tanzu CLI and Other Tools.

Note: If you use vSphere with Tanzu, you need Tanzu CLI v1.5.x and your vSphere with Tanzu clusters must use the v1alpha2 API to run the node-pool commands successfully. For more information, see the vSphere with Tanzu documentation.

Command Options Description
tanzu *
-h, –help
Common Tanzu Kubernetes Grid Options
tanzu completion * Output shell completion code for the specified shell
tanzu cluster *
–log-file
-v,, –verbose
tanzu cluster available-upgrades get Upgrade Tanzu Kubernetes Clusters
tanzu cluster create
-d, –dry-run Create Tanzu Kubernetes Cluster Manifest Files
-f, –file Deploy Tanzu Kubernetes Clusters
–tkr Deploy Tanzu Kubernetes Clusters with Different Kubernetes Versions
Add a vSphere with Tanzu Supervisor Cluster as a Management Cluster
tanzu cluster credentials update
-n, –namespace
–vsphere-password
–vsphere-user
Manage Cluster Secrets
tanzu cluster delete
-n, –namespace
-y, –yes
Delete Tanzu Kubernetes Clusters
tanzu cluster get
–disable-grouping
–disable-no-echo
-n, –namespace –show-all-conditions
Deploy Tanzu Kubernetes Clusters
tanzu cluster kubeconfig get Deploy Tanzu Kubernetes Clusters
Connect to and Examine Tanzu Kubernetes Clusters
–admin
–export-file
-n, –namespace
Connect to and Examine Tanzu Kubernetes Clusters
Upgrade Tanzu Kubernetes Clusters
tanzu cluster list
–include-management-cluster Connect to and Examine Tanzu Kubernetes Clusters
Upgrade Management Clusters
Upgrade Tanzu Kubernetes Clusters
-n, –namespace
-o, –output
Connect to and Examine Tanzu Kubernetes Clusters
tanzu cluster machinehealthcheck Configure Machine Health Checks for Tanzu Kubernetes Clusters
tanzu cluster node-pool set
-f, –file
–namespace
–machine-deployment-base
Manage Node Pools of Different VM Types
tanzu cluster node-pool list
-n, –namespace
-o, –output
Manage Node Pools of Different VM Types
tanzu cluster node-pool delete
-n, –name
–namespace
Manage Node Pools of Different VM Types
tanzu cluster scale
-c, –controlplane-machine-count
-n, –namespace
-p, –node-pool name
-w, –worker-machine-count
Manage Your Management Clusters
Manage Node Pools of Different VM Types
Scale Tanzu Kubernetes Clusters
tanzu cluster upgrade
-n, –namespace
–os-arch
–os-name
–os-version
-t, –timeout
–tkr
-y, –yes
Upgrade Tanzu Kubernetes Clusters
Deploy Tanzu Kubernetes Clusters with Different Kubernetes Versions
tanzu config get Shows the current configuration
tanzu config init Initializes the configuration with defaults
tanzu config server delete
-y, –yes Delete Management Clusters from Your Tanzu CLI Configuration
tanzu config server list Delete Management Clusters from Your Tanzu CLI Configuration
tanzu config set Sets configuration parameters in the Tanzu CLI configuration file, /.config/tanzu/config.yaml
tanzu config unset Unsets configuration parameters in the Tanzu CLI configuration file, /.config/tanzu/config.yaml
tanzu init Initializes the Tanzu CLI
tanzu kubernetes-release get
tanzu kubernetes-release available-upgrades get
Deploy Tanzu Kubernetes Clusters with Different Kubernetes Versions
Upgrade Tanzu Kubernetes Clusters
Add a vSphere with Tanzu Supervisor Cluster as a Management Cluster
tanzu kubernetes-release os get
–region
tanzu login
–apiToken
–context
–endpoint
–kubeconfig
–name
–server
Connect to and Examine Tanzu Kubernetes Clusters
Manage Your Management Clusters
Add a vSphere with Tanzu Supervisor Cluster as a Management Cluster
tanzu mc ceip-participation get
tanzu mc ceip-participation set
Opt In or Out of the VMware CEIP
tanzu mc create
-b, –bind
–browser
-u, –ui
Deploy Management Clusters with the Installer Interface
-f, –file
-t, –timeout
-y, –yes
–dry-run
Deploy Management Clusters from a Configuration File
-e, –use-existing-bootstrap-cluster
Use an Existing Bootstrap Cluster to Deploy and Delete Management Clusters
tanzu mc credentials update Manage Cluster Secrets
tanzu mc delete Delete Management Clusters
tanzu mc get Connect to and Examine Tanzu Kubernetes Clusters
Examine the Management Cluster Deployment
Manage Your Management Clusters
Upgrade Management Clusters

tanzu mc import. This command is not used in TKG 1.4. Upgrade Tanzu Kubernetes Grid
tanzu mc kubeconfig get
–admin
–export-file
Examine the Management Cluster Deployment
Configure RBAC
tanzu mc permissions aws generate-cloudformation-template
tanzu mc permissions aws set
Prepare to Deploy Management Clusters to AWS
tanzu mc upgrade
–os-arch
–os-name
–os-version
-t, –timeout
-y, –yes
Upgrade Management Clusters
tanzu package * Installs and manages packages and package repositories
tanzu pinniped-auth * Pinniped authentication operations
tanzu pinniped-auth login *
–ca-bundle strings, –client-id string, –concierge-authenticator-name string, –concierge-authenticator-type, –concierge-ca-bundle-data string, –concierge-authenticator-name string, –concierge-authenticator-type, –concierge-ca-bundle-data string, –concierge-endpoint string, –concierge-namespace string, –enable-concierge, –issuer string, –listen-port uint16, –request-audience string, –scopes strings, –session-cache string, –skip-browser
Log in using an OpenID Connect provider
tanzu plugin clean
tanzu plugin install
tanzu plugin list
Install the Tanzu CLI
tanzu plugin delete * Deletes a Tanzu plugin
tanzu plugin describe * Describes a Tanzu plugin
tanzu plugin sync Syncs Plugins
tanzu plugin upgrade * Upgrades a Tanzu plugin
tanzu secret registry
–help
tanzu secret registry add Adds a registry authentication secret
–server
–username
–export-to-all-namespaces

tanzu secret registry list Lists the registry authentication secrets in a workload cluster
–namespace
tanzu secret registry delete Deletes a registry authentication secret in a workload cluster
–namespace
tanzu secret registry update Updates a registry authentication secret in a workload cluster
–export-to-all-namespaces
tanzu update * Updates the Tanzu CLI
tanzu version Shows the current Tanzu CLI version. This is the same as the current version of Tanzu Framework, which includes the Tanzu CLI.

* Some tanzu plugin commands such as tanzu plugin repo and tanzu plugin update are not functional in the current release.

  • The alias mc is short for management-cluster.

Tanzu CLI Configuration

The Tanzu CLI configuration file, ~/.config/tanzu/config.yaml, contains your Tanzu CLI configuration, including:

  • Sources for CLI plugin discovery
  • Global and plugin-specific configuration options, or features
  • Names, contexts, and kubeconfig locations for the management clusters that the CLI knows about, and which is the current one

You can use the tanzu config set PATH VALUE and tanzu config unset PATH commands to customize your CLI configuration, as described in the table below. Running these commands updates the ~/.config/tanzu/config.yaml file.

Path Value Description
env.VARIABLE Your variable value; for example, Standard_D2s_v3 This path sets or unsets global environment variables for the CLI. Variables set by running tanzu config set persist until you unset them with tanzu config unset. You can set any of the variables listed in Tanzu CLI Configuration File Variable Reference. For example, tanzu config set env.AZURE_NODE_MACHINE_TYPE Standard_D2s_v3.
features.global.FEATURE true or false This path activates or deactivates global features in your CLI configuration. Use only if you want to change or restore the defaults. For example, tanzu config set features.global.context-aware-cli-for-plugins true.
features.PLUGIN.FEATURE true or false This path activates or deactivates plugin-specific features in your CLI configuration. Use only if you want to change or restore the defaults; some of these features are experimental and intended for evaluation and test purposes only. For example, running tanzu config set features.cluster.dual-stack-ipv4-primary true sets the dual-stack-ipv4-primary feature of the cluster CLI plugin to true. By default, only production-ready plugin features are set to true in the CLI. For more information, see Experimental Tanzu CLI Features.
unstable-versions none (default), alpha, experimental, and all

This path sets the clientOptions.cli.unstableVersionSelector property in the CLI configuration file. By default, the CLI uses only stable versions of CLI plugins. You can modify this behavior by setting unstable-versions to alpha, experimental, or all:

  • none: Allows only stable plugin versions. clientOptions.cli.unstableVersionSelector is set to none by default.
  • alpha: Allows stable and alpha plugin versions.
  • experimental: Allows stable and pre-release plugin versions, including alpha versions.
  • all: Allows all plugin versions, including stable, pre-release, and build-tagged versions.

To restore the default, set unstable-versions to none.

The table below lists the global and plugin-specific features that you can configure in the Tanzu CLI.

Features

Name Default Description
Global features:
context-aware-cli-for-plugins true Enables auto-discovery of CLI plugins.
management-cluster plugin features:
custom-nameservers false (Experimental, vSphere only) Allows you to configure custom DNS servers for control plane and worker nodes. This feature is in development.
dual-stack-ipv4-primary false (Experimental, vSphere only) Allows you to deploy dual-stack clusters, with IPv4 as the primary protocol. This feature is in development.
dual-stack-ipv6-primary false (Experimental, vSphere only) Allows you to deploy dual-stack clusters, with IPv6 as the primary protocol. This feature is in development.
export-from-confirm true Enables the Export Configuration button in the Tanzu Kubernetes Grid installer interface.
import false Allows you to import the cluster configuration file into the Tanzu Kubernetes Grid installer interface. This feature is not available in Tanzu Kubernetes Grid v1.5.
standalone-cluster-mode false Enables you to deploy standalone clusters in Tanzu Community Edition. This feature is not available in Tanzu Kubernetes Grid.
cluster plugin features:
custom-nameservers false See above.
dual-stack-ipv4-primary false See above.
dual-stack-ipv6-primary false See above.

Configuration Value Precedence

When the Tanzu CLI creates a cluster, it reads in values for the variables listed in Tanzu CLI Configuration File Variable Reference from multiple sources. If those sources conflict, it resolves conflicts in the following order of descending precedence:

Processing layers, ordered by descending precedence Source Examples
1. Management cluster configuration variables set in the installer interface Entered in the installer interface launched by the –ui option, and written to cluster configuration files. File location defaults to /.config/tanzu/tkg/clusterconfigs/. Worker Node Instance Type dropdown with Standard_D2s_v3 selected
2. Cluster configuration variables set in your local environment Set in shell. export AZURE_NODE_MACHINE_TYPE=Standard_D2s_v3
3. Cluster configuration variables set in the Tanzu CLI, with tanzu config set env. Set in shell; saved in the global Tanzu CLI configuration file, /.config/tanzu/config.yaml. tanzu config set env.AZURE_NODE_MACHINE_TYPE Standard_D2s_v3
4. Cluster configuration variables set in the cluster configuration file Set in the file passed to the –file option of tanzu management-cluster create or tanzu cluster create. File defaults to ~/.config/tanzu/tkg/cluster-config.yaml. AZURE_NODE_MACHINE_TYPE: Standard_D2s_v3
5. Factory default configuration values Set in providers/config_default.yaml. Do not modify this file. AZURE_NODE_MACHINE_TYPE: “Standard_D2s_v3”

The Tanzu CLI also uses component version configuration from:

  • Global cluster configuration file, ~/.config/tanzu/tkg/config.yaml
  • Tanzu Kubernetes Grid and Tanzu Kubernetes release Bill of Materials (BoM) files, in ~/.config/tanzu/tkg.

Do not modify these files.

Renew CLI Certificate

On the bootstrap machine, the CLI uses a certificate that is stored locally to authenticate with the management cluster. If the certificate expires, you will see failed error messages when running tkg or tanzu CLI commands.

Therefore, when the certificate nears expiration, follow these steps to renew the certificate. The following steps use tanzu CLI commands.

  1. Get the name of the management cluster.

    tanzu mc get

  2. Get the cluster configuration data. You will copy the data to populate the ~/.kube-tkg/config file.

    kubectl -n tkg-system get secrets <cluster name>-kubeconfig -o 'go-template={{ index .data "value"}}' | base64 -d > mc_kubeconfig.yaml

    Where <cluster name> is the name of the management cluster. For example:

    apiVersion: v1
    clusters:
    - cluster:
      certificate-authority-data: LS0tLS1CRUdJTiBD<redacted>
      server: https://192.168.100.90:6443
      name: tkg-mgmt
    contexts:
    - context:
      cluster: tkg-mgmt
      user: tkg-mgmt-admin
      name: tkg-mgmt-admin@tkg-mgmt
    current-context: tkg-mgmt-admin@tkg-mgmt
    kind: Config
    preferences: {}
    users:
    - name: tkg-mgmt-admin
      user:
      client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZ<redacted>
      client-key-data: LS0tLS1CRUdJTiBSU<redacted>`
    
  3. Delete the existing management cluster entry from Tanzu managed servers.

    tanzu config server delete <cluster-name>

  4. Use tanzu login command to add the management-cluster entry with the new updated kubeconfig.

    tanzu login --kubeconfig mc_kubeconfig.yaml --name <cluster-name> --context <cluster-name>-admin@<cluster-name>

Sync New Plugins

The tanzu plugin sync command discovers and downloads new CLI plugins that are associated with either a newer version of Tanzu Kubernetes Grid, or a package installed on your management cluster that your local CLI does not know about, for example if another user installed it.

Run this command when:

  • You install the Tanzu CLI for the first time or upgrade to a newer version of Tanzu Kubernetes Grid. For more information, see Install the Tanzu CLI Plugins in Install the Tanzu CLI and Other Tools.

  • You are already logged in to a management cluster and another user installs a package with an associated CLI plugin on the same management cluster. If you are not logged in, these CLI plugins will be installed when you run tanzu login.

check-circle-line exclamation-circle-line close-line
Scroll to top icon