安装
brew install kubectl
配置自动补全
The kubectl completion script for Zsh can be generated with the command kubectl completion zsh. Sourcing the completion script in your shell enables kubectl autocompletion.
To do so in all your shell sessions, add the following to your ~/.zshrc
file:
source <(kubectl completion zsh)
If you have an alias for kubectl, you can extend shell completion to work with that alias:
echo 'alias k=kubectl' >>~/.zshrc
echo 'complete -F __start_kubectl k' >>~/.zshrc
After reloading your shell, kubectl autocompletion should be working.
If you get an error like complete:13: command not found: compdef, then add the following to the beginning of your ~/.zshrc
file:
autoload -Uz compinit
compinit
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/100386.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...