kubectx + kubens: Power tools for kubectl
Faster way to switch between clusters and namespaces in kubectl.kubectx
Switch between Kubernetes contexts (clusters) quickly
kubens
Switch between Kubernetes namespaces effortlessly
What are kubectx and kubens?
kubectx is a tool to switch between contexts (clusters) on kubectl faster. kubens is a tool to switch between Kubernetes namespaces (and configure them for kubectl) easily. Both tools support:- Tab completion on bash/zsh/fish shells
- Interactive mode with fzf for fuzzy searching
- Quick switching back to previous context/namespace with
- - Color-coded output for current context/namespace
Quick Examples
kubectx Examples
kubens Examples
Key Features
Interactive Mode
Install fzf for interactive fuzzy search of contexts and namespaces
Shell Completion
Tab completion support for bash, zsh, and fish shells
Previous Selection
Quickly switch back to your previous context or namespace with
-Customizable Colors
Customize output colors with environment variables
Implementation
kubectx and kubens are available in two implementations:- Bash scripts: Stable, lightweight scripts included in the repository
- Go binaries: Rewritten in Go (v0.9.0+) with new features and improvements
Next Steps
Installation
Get started with kubectx and kubens on your platform
Usage Guide
Learn all the ways to use kubectx and kubens
Pair kubectx and kubens with kube-ps1 to add context/namespace information to your shell prompt.