Closed gmiroshnykov closed 6 years ago
I think in general I'm open to it, we can put it behind an installation flag as experimental.
However, I am inclined to think there are not many people doing this. kubectl does not even provide any commands to add/switch/delete user
configs. (https://github.com/kubernetes/kubectl/issues/396).
If it's an exotic/rare use case, we'd like to keep it out to prevent feature creep. So, first I'd like to understand if there are more people like you.
This is likely a wontfix for now.
I should mention that I actually have it implemented here: https://github.com/laggyluke/kubectx/tree/kubeclr
I didn't have enough time to add completion support and update docs, but if it'll turn out I'm not the only one who was looking for this feature - just let me know and I'll prepare a proper PR :)
This might be a bit too philosophical, but here it goes.
In kubeconfig, Context is a thing that binds together Cluster, User and Namespace.
We have a
kubectx
command that mutates globalcurrent-context
in kubeconfig. We also have akubens
command that mutatesnamespace
inside the current Context.So why don't we have a
kubecl
(name TBD) that mutatescluster
inside the current Context? And maybe evenkubeusr
(or something) that does the same foruser
?As far as I understand, the current assumption behind kubectx is that each Context is completely isolated (e.g. minikube vs GKE), so switching between Clusters while keeping User and even Namespace is meaningless.
On the other hand, I'd like to be able to switch between multiple production Clusters while keeping the same User and Namespace. With an extra benefit of not having to create N contexts for managing N clusters.
Do you think such a PR would be a good idea?