Ubuntu kubectl 命令自动补全
- 安装bash-completion
- 重新加载kubectl completion
- tab补全命令
[root@k8s-master01 ~]# apt install -y bash-completion
[root@k8s-master01 ~]# apt install -y mlocate
[root@k8s-master01 ~]# locate bash_completion
[root@k8s-master01 ~]# source /usr/share/bash-completion/bash_completion
[root@k8s-master01 ~]# source <(kubectl completion bash)
[root@k8s-master01 ~]#
[root@k8s-master01 ~]#
[root@k8s-master01 ~]# kubectl get pod
poddisruptionbudgets.policy podsecuritypolicies.policy
pods podtemplates
[root@k8s-master01 ~]#