ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.66k stars 1.26k forks source link

proposal: adds ENV variable for current context #369

Closed rbabyuk-vs closed 1 year ago

rbabyuk-vs commented 1 year ago

I wish I had control over current context in case I have several terminals or terminal apps, where I can select different context so I can jump between clusters depending on window/tab/terminal app. I propose to introduce a new environment variable to control this

ppastorf commented 1 year ago

@rbabyuk-vs if you dont bother splitting your config files, you can separate your contexts and manage them with KUBECONFIG variable, at least thats the way I do it

ahmetb commented 1 year ago

This was previously proposed for kubectl directly. In order to be able to do this, you'd need to install something in your shell for kubectx and source it in your bashrc/zshrc/fish thing whatnot which makes the installation/usage experience way more difficult than it is.

What I'll be investing on is letting users create subshells with a readonly copy containing only one context, so that each shell can be isolated from one another. Make sure to check out #12 for the details.