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 Service Clusters Using vCenter SSO Authentication.
  2. Install and initialize the Tanzu CLI. See Install the Tanzu CLI for Use with TKG Service Clusters.

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 context create context_name --kubeconfig ~/.kube/config --kubecontext SUPERVISOR-CONTROL-PLANE-IP-ADDRESS
    Where:
    • context_name is the user-defined name for this context, such as "supervisor".
    • --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.
    • --kubecontext SUPERVISOR-CONTROL-PLANE-IP-ADDRESS is the context of the Supervisor, which is the same as SUPERVISOR_IP, such as 10.179.144.55.
  4. Run Tanzu CLI commands and verify connectivity.
    tanzu plugin list
    tanzu cluster list -n VSPHERE-NS-FOR-TKG