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

Support for multiple shells. #633

Open
Vad1mo opened this issue Feb 17, 2023 · 2 comments
Open

Support for multiple shells. #633

Vad1mo opened this issue Feb 17, 2023 · 2 comments
Labels
question Further information is requested

Comments

@Vad1mo
Copy link

Vad1mo commented Feb 17, 2023

Feature Request
if you work with multiple clusters, you often want to associate one terminal window to a cluster. With kubectx and many other tools including kubecm this is not possible. A few tools where this is possible, they use subshells, which has its set of issues.

Describe the solution you'd like
it should be possible to have multiple shells that use different Kubernetes contexts

Describe alternatives you've considered
I am currently using a combination of different tools to accomplish this.
kubens and https://github.com/danielfoehrKn/kubeswitch

Additional context
Add any other context or screenshots about the feature request here.

@sunny0826
Copy link
Owner

@Vad1mo Good idea, but kubecm is only used to manage kubeconfig, if you want to specify the current shell's cluster, you need to modify the current-context field in kubeconfig.

To implement this, you need multiple copies of the kubeconfig file, and then specify in kubectl to use that configuration file.

just like:

kubectl get pod --kubeconfig .kube/config

@sunny0826
Copy link
Owner

You can use alias to simplify this command above.

Edit your .zshrc( or .bashrc) file like this:

...
alias k1='kubectl --kubeconfig .kube/config1'
alias k2='kubectl --kubeconfig .kube/config2'

After that you can use different commands to operate different clusters.

k1 get pod
k2 get pod

@sunny0826 sunny0826 added the question Further information is requested label Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants