安装配置kubectl

  1. yum install -y kubectl --disableexcludes=kubernetes
  2. mkdir -p $HOME/.kube
  3. sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  4. sudo chown $(id -u):$(id -g) $HOME/.kube/config

配置kubectl输入命令自动补全

  1. yum install -y bash-completion
  2. source /usr/share/bash-completion/bash_completion
  3. source <(kubectl completion bash)
  4. echo "source <(kubectl completion bash)" >> ~/.bashrc
  5. echo "alias k=kubectl" >> ~/.bashrc
文档更新时间: 2020-04-23 04:27   作者:admin