设置kubectl自动补全
作者:互联网
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
就可以愉快的使用自动补全啦~
标签:completion,kubectl,补全,bashrc,share,source,自动,bash 来源: https://www.cnblogs.com/xjzyy/p/15951848.html