kubectx and kubens can be installed and used as native kubectl plugins through Krew, the kubectl plugin manager. This provides seamless integration with your kubectl workflow.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ahmetb/kubectx/llms.txt
Use this file to discover all available pages before exploring further.
Installation via Krew
Install Krew
If you don’t have Krew installed, follow the Krew installation guide.
Krew installation does not include shell completion scripts. If you need tab completion, install the scripts manually or use another installation method like Homebrew.
Usage as kubectl Plugins
Once installed via Krew, the tools are available askubectl ctx and kubectl ns instead of standalone commands.
kubectl ctx Commands
All standard kubectx operations work with thekubectl ctx prefix:
kubectl ns Commands
All standard kubens operations work with thekubectl ns prefix:
Interactive Mode with fzf
When fzf is installed, the kubectl plugin versions support the same interactive fuzzy-search functionality:Disabling Interactive Mode
To disable fzf integration even when fzf is installed:Advantages of kubectl Plugin Usage
Unified kubectl interface
Unified kubectl interface
All your Kubernetes tools are accessible through the
kubectl command, providing a consistent user experience.Easier discovery
Easier discovery
Users can discover available plugins using
kubectl plugin list or kubectl krew search.Easy updates
Easy updates
Update both tools with a single command:
Cross-platform compatibility
Cross-platform compatibility
Krew handles platform-specific installation details automatically.