virtuallypotato/content/posts/2022/accessing-tce-cluster-from-new-device/index.md
2022-02-02 10:24:19 -06:00

2.9 KiB
Raw Blame History

title date description featured draft toc usePageBundles codeLineNumbers series tags comment
Accessing a Tanzu Community Edition Kubernetes Cluster from a new device 2022-02-01T10:58:57-06:00 The Tanzu Community Edition documentation does a great job of explaining how to authenticate to a newly-deployed cluster at the tail end of the installation steps, but how do you log in from another system? false true false true false Tips
vmware
kubernetes
tanzu
true

When I recently set up my Tanzu Community Edition environment, I did so from a Linux VM since I knew that my Chromebook Linux environment wouldn't support the kind bootstrap cluster used for the deployment. But now I'd like to be able to connect to the cluster directly using the tanzu and kubectl CLI tools. How do I get the appropriate cluster configuration over to my Chromebook?

The Tanzu CLI actually makes that pretty easy. I just run these commands on my Linux VM to export the kubeconfig of my management (tce-mgmt) and workload (tce-work) clusters to a pair of files:

tanzu management-cluster kubeconfig get --admin --export-file tce-mgmt-kubeconfig.yaml
tanzu cluster kubeconfig get tce-work --admin --export-file tce-work-kubeconfig.yaml

I could then use scp to pull the files from the VM into my local Linux environment. I then needed to install kubectl and the tanzu CLI (making sure to also enable shell auto-completion along the way!), and I could import the configurations locally:

 tanzu login --kubeconfig tce-mgmt-kubeconfig.yaml --context tce-mgmt-admin@tce-mgmt --name tce-mgmt
✔  successfully logged in to management cluster using the kubeconfig tce-mgmt

 tanzu login --kubeconfig tce-work-kubeconfig.yaml --context tce-work-admin@tce-work --name tce-work
✔  successfully logged in to management cluster using the kubeconfig tce-work