k8s命令补全

依次执行以下四条命令即可完成k8s的命令补全


yum -y install bash-completion

source /usr/share/bash-completion/bash_completion

source <(kubectl completion bash)

echo "source <(kubectl completion bash)" >> ~/.bashrc

补全效果

[root@k8s-master ~]# kubectl
annotate autoscale cordon drain kustomize port-forward set
api-resources certificate cp edit label proxy taint
api-versions cluster-info create exec logs replace top
apply completion delete explain options rollout uncordon
attach config describe expose patch run version
auth convert diff get plugin scale wait

————————————————
版权声明:本文为CSDN博主「s波塞冬」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接https://blog.csdn.net/m0_46674735/article/details/114881063

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...