I followed the instructions for installing Bash completion as given by kubectl completion -h:
bash-completion via Homebrew~/.bashrc, I first source bash-completion then output from the completion kubectl subcommand:
source $(brew --prefix)/etc/bash_completionsource <(kubectl completion bash)With these in place, I start up a new shell but the completion doesn't work. How do I get it working?
Once bash-completion is installed by Homebrew, it appears that its completions
need to reside in $(brew --prefix)/etc/bash_completion.d. There you'll find a lot of other completions that come bundled. To add the completion for kubectl:
$ kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
That did the trick for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With