A kubectl plugin for interactively changing your kubeconfig context.
This makes it easier to work with multiple clusters from the same machine.
Also see kubectl-ns for switching between namespaces.
To install the plugin, download the kubectl-ctx file and save it in any directory that is in your PATH:
curl -O https://raw.githubusercontent.com/weibeld/kubectl-ctx/master/kubectl-ctxThen, make the kubectl-ctx file executable:
chmod +x kubectl-ctxNow, you can verify that the plugin is correctly installed by running the following command:
kubectl plugin listThis lists all the plugins that kubectl detected, and the kubectl-ctx plugin should now be listed there.
To uninstall the plugin, simply delete the kubectl-ctx file.
Change the current context:
kubectl ctxList all contexts:
kubectl ctx -lWhen you run kubectl ctx, the plugin changes the current-context element of your kubeconfig configuration:
Note that this includes a physical change to one of your kubeconfig files (the default kubeconfig file is ~/.kube/config, but you can have multiple kubeconfig files by by listing them in the KUBECONFIG environment variable).
When you run kubectl ctx -l, the plugin displays the names of all the contexts in your kubeconfig configuration.
The plugin depends on the fzf command being available on your system.
You can install fzf as follows:
- Homebrew (macOS) and Linuxbrew (Linux):
brew install fzf
- From source (macOS and Linux):
git clone https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install
- For further installation options, see here

