Follow these steps to connect to Supervisor using the Tanzu CLI and authenticate as a vCenter Single Sign-On user.

Prerequisites

Complete the following prerequisites.
  1. Install and configure the Kubernetes CLI Tools for vSphere. See Connecting to TKG Clusters on Supervisor Using vCenter SSO Authentication.
  2. Install and initialize the Tanzu CLI. See Install the Tanzu CLI for Use with TKG Clusters on Supervisor.

Connect to Supervisor Using the Tanzu CLI and vCenter SSO

Complete the following steps.
  1. Connect to Supervisor as a vCenter SSO user.
    kubectl vsphere login --server=SUPERVISOR-CONTROL-PLANE-IP-ADDRESS --vsphere-username VCENTER-SSO-USER

    This action populates kubeconfig with the Supervisor context that the Tanzu CLI uses.

  2. Switch context to the vSphere Namespace for Supervisor.
    kubectl config get-contexts
    kubectl config use-context <SUPERVISOR-CONTROL-PLANE-IP-ADDRESS>
  3. Log in to Supervisor using the Tanzu CLI and vCenter SSO.
    tanzu login --kubeconfig ~/.kube/config --context SUPERVISOR-CONTROL-PLANE-IP-ADDRESS --name supervisor
    Where:
    • --kubeconfig ~/.kube/config is the path to the local kubeconfig file, which defaults to ~/.kube/config and is set by the KUBECONFIG environment variable, and which contains the Supervisor configuration context for your vCenter SSO user.
    • --context SUPERVISOR-CONTROL-PLANE-IP-ADDRESS is the context of the Supervisor, which is the same as SUPERVISOR_IP, such as 10.179.144.55.
    • --name supervisor is the user-defined name for the Tanzu CLI to use for this context.
  4. Run Tanzu CLI commands and verify connectivity.
    tanzu plugin list
    tanzu cluster list -n VSPHERE-NS-FOR-TKG