A kubernetes context and kubectl switcher
██╗ ██╗████████╗██╗ ██╗
██║ ██╔╝╚══██╔══╝╚██╗██╔╝
█████╔╝ ██║ ╚███╔╝
██╔═██╗ ██║ ██╔██╗
██║ ██╗ ██║ ██╔╝ ██╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
Kubectl Context Switcher
Install with homebrew
brew tap peledies/formulae
brew install ktx
brew update
brew upgrade ktx
Ktx requires a few modifications to your profile to work effectively.
NOTE: as of version
0.4.0ktx will help you create the required modifications to your path and profile.
Add the following lines to your profile ~/.bash_profile, ~/.bashrc or ~/.zshrc
This tells your system where your
ktxinstalled versions ofkubectlreside
# Kubectl versions installed with ktx
PATH=$HOME/.kube/kubectl:$PATH
This loads
ALLkubernetes config files into memory soktxcan build its menu
# Load all the config files in the .kube directory
export KUBECONFIG=$(find ~/.kube -name 'config*' | sort | tr '\n' ':')
In order for KTX to find your kubernetes configs in your lastpass, you need to set up a folder for them and they need to be of a specific custom item type.
- Create a new custom type in Lastpass.
- Name it
Kubernetes-Config-Rawand make sure it has a singlenotesfield.
- Create a new
Kubernetes-Config-Rawrecord and name it something useful to you. Put the contents of your kube config for that single cluster in theNotesinput.
- Make sure your
Kubernetes-Config-Rawrecords are in thekubernetes-configs(all lowercase) folder.



