kubectl命令自动补全
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
source ~/.bashrc
echo "source /usr/share/bash-completion/bash_completion">>/root/.bashrc
source /root/.bashrc
就可以愉快的使用自动补全啦~