I have several K8s clusters I choose from, some are version 1.23, some 1.27. Since kubectl is officially supported one version up one version down, to be on the safe side I always have to remember to manually change the kubectl binary I'm using. Would be nice if it was possible to make that part of the selection process of kubectx. I can think of several different ways to do that:
Have something like a hook script or command associated with a given cluster, which could be configured to somehow change the kubectl binary the system uses, e.g. via asdf.
Even better: Have kubectx work it out by itself with kubectl version and update (maybe with the help of asdf) the kubectl version in use.
I have several K8s clusters I choose from, some are version 1.23, some 1.27. Since
kubectl
is officially supported one version up one version down, to be on the safe side I always have to remember to manually change thekubectl
binary I'm using. Would be nice if it was possible to make that part of the selection process ofkubectx
. I can think of several different ways to do that:Have something like a hook script or command associated with a given cluster, which could be configured to somehow change the
kubectl
binary the system uses, e.g. viaasdf
.Even better: Have kubectx work it out by itself with
kubectl version
and update (maybe with the help ofasdf
) the kubectl version in use.