在Linux上
代码语言:javascript复制# yum install -y bash-completion
# echo -e "source /usr/share/bash-completion/bash_completionnsource <(kubectl completion bash)" >>/root/.bashrc
在Mac上
代码语言:javascript复制$ brew install bash-completion
$ source $(brew --prefix)/etc/bash_completion
$ source <(kubectl completion bash)