Update the kubeconfig file for a cluster, so that you can choose which CLI to use.

During the deprecation period for the tmc CLI, you can choose to use either the tanzu CLI or the old tmc CLI.

The kubeconfig file that Tanzu Mission Control generates when you access a cluster contains arguments that enable access using the CLI that you choose. These arguments are not compatible between the old tmc CLI and the new tanzu CLI.

If you have both CLIs installed, make sure your kubeconfig matches the CLI you want to use.

If you try to access a cluster using kubectl when the kubeconfig does not match the installed CLI, you see an error like this:
Unable to connect to the server: getting credentials: exec: executable tanzu not found

Prerequisites

This procedure assumes that you have access to a cluster managed through Tanzu Mission Control and that you have both the tmc CLI and the kubectl CLI installed.

Procedure

  1. Install the CLI you want to use, either tanzu or tmc.
  2. Retrieve the kubeconfig file for your cluster, as described in Connect to a Managed Cluster with kubectl.
  3. Verify your CLI connection.
    Run the following command to verify that you can access the cluster with kubectl.
    kubectl get ns --kubeconfig=/path-to/my-modified-kubeconfig