Skip to content
/ ktx Public

Switch between kubectl contexts and manage and use multiple kubectl versions.

License

Notifications You must be signed in to change notification settings

peledies/ktx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KTX

A kubernetes context and kubectl switcher

██╗  ██╗████████╗██╗  ██╗
██║ ██╔╝╚══██╔══╝╚██╗██╔╝
█████╔╝    ██║    ╚███╔╝
██╔═██╗    ██║    ██╔██╗
██║  ██╗   ██║   ██╔╝ ██╗
╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝
Kubectl Context Switcher

Installation

Install with homebrew

brew tap peledies/formulae
brew install ktx

Upgrading

brew update
brew upgrade ktx

Configuration

Ktx requires a few modifications to your profile to work effectively.

NOTE: as of version 0.4.0 ktx will help you create the required modifications to your path and profile.

PATH

Add the following lines to your profile ~/.bash_profile, ~/.bashrc or ~/.zshrc

This tells your system where your ktx installed versions of kubectl reside

# Kubectl versions installed with ktx
PATH=$HOME/.kube/kubectl:$PATH

This loads ALL kubernetes config files into memory so ktx can build its menu

# Load all the config files in the .kube directory
export KUBECONFIG=$(find ~/.kube -name 'config*' | sort | tr '\n' ':')

LastPass Integration

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.

  1. Create a new custom type in Lastpass.

  1. Name it Kubernetes-Config-Raw and make sure it has a single notes field.

  1. Create a new Kubernetes-Config-Raw record and name it something useful to you. Put the contents of your kube config for that single cluster in the Notes input.

  1. Make sure your Kubernetes-Config-Raw records are in the kubernetes-configs (all lowercase) folder.

About

Switch between kubectl contexts and manage and use multiple kubectl versions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages