Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvment: Tanzu CLI create useful context names #843

Open
Jeremy-Boyle opened this issue Jan 14, 2025 · 0 comments
Open

Improvment: Tanzu CLI create useful context names #843

Jeremy-Boyle opened this issue Jan 14, 2025 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature needs-triage

Comments

@Jeremy-Boyle
Copy link

A great improvement would be setting the tanzu-cli context that gets created via idp to something useful.

for example with pinniped and tgks:
tanzu-cli-2ffcf2bc-4400-45a1-9868-39bf6740702b@2ffcf2bc-4400-45a1-9868-39bf6740702b

This isn't exactly useful at all if you have multiple environments, I glanced over some of the code, but didn't notice anything useful that was being provided while stepping, I wasn't able to directly find where or how that pinniped plugin is being built. I assume its a private repo.

Suggestion might be utilizing the endpoint for something useful but parse the http:// or another environment variable that would allow the user to change it.

examples:

tanzu context create tkgs-dev --endpoint https://some-dns-name.com
[email protected]

# Or the ip respectively
tanzu-cli-2ffcf2bc-4400-45a1-9868-39bf6740702b@ip-addr

# Or potentially use both along with ctxName
[email protected]

I've been doing the following as a work around for the issue in the mr , but also to name the context something useful that then could be used for access to the supervisor. I did take a look around at the wcp nginx proxy, but unfortunately its not passing anything that I can see that would be useful to get the actual supervisor name from vCenter.

# This will fail out and create a new context in your kubeconfig
tanzu context create  context-name --endpoint https://some.fqdn.com
# Rename the newly created context name to something useful
kubectl config rename-context tanzu-cli-{guid-id}@{guid-id} new-context-name
# Add it to tanzu context create
tanzu context create context-name --kubeconfig ~/.kube/config --kubecontext new-context-name

I'd be happy to provide a MR and move this discussion to a new issue/MR if its something that you think would be a improvement.

@Jeremy-Boyle Jeremy-Boyle added kind/feature Categorizes issue or PR as related to a new feature needs-triage labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant