kubectx
kubectx copied to clipboard
Autocomplete does not work when installed as Krew plugin
# Enable shell completion
autoload -U compinit; compinit
# Install Krew - the package manager for kubectl plugins
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion
source <(kubectl completion zsh)
I would expect kubectl ctx CL<tab><tab> to show CLUSTER.
It's a known problem, we need to implement shell completion installation in Krew first, then make this plugin's krew distribution use it.
I believe this is now possible if there were a couple of commands installed: kubectl_complete-ctx and kubectl_complete-ns