This site will be decommissioned on December 31st 2024. After that date content will be available at techdocs.broadcom.com.

Tanzu CLI Architecture and Configuration

This topic provides information about Tanzu CLI architecture. It also explains how to update your Tanzu CLI configuration.

CLI Architecture

The Tanzu CLI uses a context-scoped, pluggable architecture that lets you connect to servers of multiple types and run the appropriate commands on each. For example, you can use the Tanzu CLI to connect to these Tanzu products:

Command Groups and Targets

Tanzu CLI commands are organized into command groups. To list available command groups, run tanzu.

The list of available command groups differs based on what Tanzu CLI plugins are installed on your machine, and on what type of server you are currently logged in to. Both of these depend on the Tanzu products that you are using.

For each command group the Tanzu CLI defines a Target, or context type, that associates the set of commands with the type of server that the commands apply to, for example:

  • Plugins that define commands for Kubernetes clusters have the Target k8s.
  • Plugins that define commands for TMC commands have the Target tmc.
  • Plugins that define context-independent commands have the Target global. These plugins are installed automatically with the Tanzu CLI.
  • Identically-named plugins for different targets let the Tanzu CLI tailor commands under command groups such as tanzu cluster to fit the context.

The tanzu plugin search command lists plugin targets under a TARGET column.

tanzu context commands let you specify a default specific server context for each target, switch targets, and list the contexts for each target using the --target flag.

CLI Core, Plugins, Plugin Groups, and Products

The core CLI has some command groups built in, and CLI plugins extend the CLI with additional command groups that are useful for particular products. Each plugin is an executable binary that packages a group of CLI commands.

Each product designates how its relevant plugins are installed, either standalone or context-scoped:

  • Standalone plugins are installed explicitly with the tanzu plugin install command.
    • The --group option installs all of the standalone plugins needed for a specific product, and tanzu plugin group get lists the plugins.
    • Standalone plugins can support install-time operations that you run before a context is created or set.
  • Context-scoped plugins are installed automatically with the tanzu context create command, as appropriate for the product that creates or registers the context.

A given product’s plugins might be installed all standalone, all context-scoped, or a mix.

This table summarizes how command groups come from the core CLI or plugins:

Source Examples: tanzu... How Installed
Core config, plugin, help Installed with the CLI
Standalone plugins apps, insight, and all other TAP plugins; management-cluster (TKG) Install with tanzu plugin install
Context-scoped plugins All TMC plugins; cluster, feature, and kubernetes-release (TKG) Installed automatically with tanzu context create

For a list of Tanzu CLI plugins and commands that they provide, see Command Groups in Tanzu CLI Command Reference.

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 servers 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 Tanzu CLI. For example, tanzu config set env.AZURE_NODE_MACHINE_TYPE Standard_D2s_v3. Variables set by running tanzu config set persist until you unset them with tanzu config unset. For a list of variables that you can set, see Configuration File Variable Reference.
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.
unstable-versions none (default), alpha, experimental, and all This path sets the clientOptions.cli.unstableVersionSelector property in the CLI configuration file. By default, the Tanzu 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.
Deprecated: bomRepo, compatibilityFilePath, edition N/A Retained for backward-compatibility with older versions of the Tanzu CLI that were bundled with TKG. Do not set.

Features

Name Default Description
Global features:
tkr-version-v1alpha3-beta false Sets the API version for the kubernetes-release plugin to v1alpha3. Do not set; reserved for future use.
management-cluster plugin features:
aws-instance-types-exclude-arm true Excludes ARM-based instance types from the list of available instance types in the Tanzu Kubernetes Grid installer interface when deploying a management cluster to AWS. This feature is set by Tanzu Kubernetes Grid; do not set manually.
dual-stack-ipv4-primary false (Technical Preview, 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 (Technical Preview, vSphere only) Allows you to deploy dual-stack clusters, with IPv6 as the primary protocol. This feature is in development.
export-from-confirm true Activates 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.6+.
standalone-cluster-mode false Allows you to deploy standalone clusters in Tanzu Community Edition. This feature is not available in Tanzu Kubernetes Grid.
cluster plugin features:
allow-legacy-cluster false Allows you to create plan-based clusters (legacy). By default, the Tanzu CLI creates class-based clusters.
auto-apply-generated-clusterclass-based-configuration false Auto-applies the class-based cluster configuration generated by the Tanzu CLI when you pass a legacy cluster configuration file to tanzu cluster create. When set to false, tanzu cluster create saves the configuration to a file without creating the cluster.
dual-stack-ipv4-primary false (Technical Preview, vSphere only) See management-cluster plugin features, above.
dual-stack-ipv6-primary false (Technical Preview, vSphere only) See management-cluster plugin features, above.
network-separation-beta Experimental. Do not enable. Reserved for future use.
package plugin features:
kctrl-command-tree true Activates or deactivates kctrl mode for tanzu package commands. This mode provides extended functionality for observability and debugging. For more information, see tanzu package with kctrl.

Activating and Deactivating Features

  • To activate a CLI feature:

    • To activate a global feature, run:

      tanzu config set features.global.FEATURE true
      

      Where FEATURE is the name of the feature that you want to activate.

    • To activate a plugin feature, run:

      tanzu config set features.PLUGIN.FEATURE true
      

      Where:

      • PLUGIN is the name of the CLI plugin. For example, cluster or management-cluster.
      • FEATURE is the name of the feature that you want to activate.
  • To deactivate a CLI feature:

    • To deactivate a global feature, run:

      tanzu config set features.global.FEATURE false
      

      Where FEATURE is the name of the feature that you want to deactivate.

    • To deactivate a plugin feature, run:

      tanzu config set features.PLUGIN.FEATURE false
      

      Where:

      • PLUGIN is the name of the CLI plugin. For example, cluster or management-cluster.
      • FEATURE is the name of the feature that you want to deactivate.
check-circle-line exclamation-circle-line close-line
Scroll to top icon