To use kubectl and
tmc (the Tanzu Mission Control CLI) with a provisioned cluster, download the generated configuration file and initialize the connection.
After you have provisioned a new cluster using Tanzu Mission Control, you can connect to it with kubectl using the configuration file that Tanzu Mission Control generates for you.
- Provision a cluster through VMware Tanzu Mission Control, as described in Provision a Cluster in Your aws-hosted Management Cluster.
- Install the Kubernetes command-line interface (kubectl).
- Open a browser window, and log in to the Tanzu Mission Control console.
- Open a command window, and log in with the Tanzu Mission Control CLI.
- In the left navigation pane of the Tanzu Mission Control console, click Clusters.
- On the Clusters page, click the cluster to which you want to connect.
- On the cluster detail page, in the upper right corner, click Access this cluster.
- In the resulting popup modal, click Download KUBECONFIG file. and save the downloaded YAML file in a location that is accessible to kubectl (for example, in ~/.kube/config or in a location specified in the KUBECONFIG environment variable).
- Run a kubectl command to initialize the configuration. For example, the following command retrieves a list of namespaces in your cluster.
kubectl get namespacesYou can optionally use the
--kubeconfigflag to specify the location and name of your downloaded kubeconfig YAML file. The command looks something like this:
kubectl --kubeconfig=/path/to/kubeconfig-my-provisioned-cluster.yml get namespacesNote: The path/file value that you pass to the
--kubeconfigflag must be an absolute path.If you are not logged in with the Tanzu Mission Control CLI, you are prompted to do so.