kubectl context switching apps
kubie
- Blog article
- GitHub
- Rust
- Arch package
- Installable from mise registry
- Config at
~/.kube/kubie.yaml
- Still no zsh completion
- Hook support for when a context is started and stopped
- Creates a new kubeconfig
/tmp/kubie-config-*.yaml
Direnv/mise support
- Direnv support
- ❌ kubie creates a new shell
whenever a new context is started. Only in this case hooks are executed, not
then using
kubie export
in the context of direnv/mise. This makes it not work properly with direnv/mise.
kubie ctx
kubeswitch
- Introduction
- GitHub
- Very active and recent development
- Install
- NOT installable from mise registry
- Supports multiple cloud provider authentication methods, i.e. the GKE store
- Supports
hooks
but hooks are only executed
- before picking a context and/or on a regular schedule (every X hours i.e.)
- FR: Support post-picking hooks Unfortunatly still open
- Direnv support
Usage:
Changes KUBECONFIG
env var to i.e. ~/.kube/.switch_tmp/config.1692710140.tmp
export KUBECONFIG=$(switcher $CONTEXT | sed 's/^__ //' | cut -d, -f1)
kubesess
- GitHub
- Rust, faster than
kubectx
- NOT installable from mise registry
- No AUR package
- Allows setting namespace/context isolated per terminal (using
KUBECONFIG
) as well as global (using~/.kube/config
) - No hook support !
Changes KUBECONFIG
env var to i.e.
KUBECONFIG=~/.kube/kubesess/cache/mastodon-dev:/home/varac/.kube/config
kubectx
- GitHub
- Slower than kubesess
- Warning: Changes context globally
Usage:
kubectx
Use shell aliases
- Warning: Changes context globally
Set namespace:
alias kcd='kubectl config set-context $(kubectl config current-context) --namespace'
kcd gitlab-nextcloud
kube-ps1
Kubernetes prompt info for bash and zsh