#402·kubectx

Allow customizing path to KUBECTX and KUBENS_DIR

Author: josegonzalezCreated Aug 24, 2023Updated Mar 9, 2026

I have dotfiles that are shared across machines. On some machines, I'd like to expose a different path for the KUBECTX file (currently defined as KUBECTX="${XDG_CACHE_HOME:-$HOME/.kube}/kubectx"). I can do this for KUBECONFIG but there isn't anything similar for kubectx.

This problem also exists for KUBENS_DIR

Would you be open to a PR to make that customizable by respecting the KUBECTX env var (if set) and KUBENS_DIR?