Skip to content

kubectl context switching apps

kubie

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.

Usage:

kubie ctx

kubeswitch

Usage:

Changes KUBECONFIG env var to i.e. ~/.kube/.switch_tmp/config.1692710140.tmp

Usage via env variable:

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