yum install -y bash-completion

source /usr/share/bash-completion/bash_completion

source <(kubectl completion bash)

 以上只是零时起作用,每次登录终端都得起效需要:

source /usr/share/bash-completion/bash_completion 
source <(kubectl completion bash)
加入到/root/.bashrc文件中。
即可以:

source <(kubectl completion bash)
echo "source <(kubectl completion bash)" >> ~/.bashrc
echo "source <(helm completion bash)" >> ~/.bashrc
 

 

posted on 2019-10-10 15:55  海豚汪洋  阅读(2248)  评论(0编辑  收藏  举报