Skip to content

Improvment: Tanzu CLI create useful context names #843

@Jeremy-Boyle

Description

@Jeremy-Boyle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new featureneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions