赞
踩
实现k8s命令自动补全,我们需要安装bash-completion
tar -xvJf bash-completion-2.11.tar.xz
cd bash-completion-2.11
source $PWD/bash_completion
#当前用户生效
echo 'source <(kubectl completion bash)' >>~/.bashrc
source ~/.bashrc
# 全局生效
kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl > /dev/null
或
echo 'source <(kubectl completion bash)' >>/etc/profile
sorce /etc/profile
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。