安装依赖
yum install -y bash-completion
生成自动完成配置
kubectl completion bash >.kubectl
添加配置到profile
cat <<EOF >>~/.bashrc if [ -f ~/.kubectl ];then . ~/.kubectl fi EOF