前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >mac下安装kubeneters及zsh下配置自动补全

mac下安装kubeneters及zsh下配置自动补全

作者头像
Java架构师必看
发布2021-07-05 15:00:49
3080
发布2021-07-05 15:00:49
举报
文章被收录于专栏:Java架构师必看

mac下安装kubeneters及zsh下配置自动补全

1. mac下使用brew安装

代码语言:javascript
复制
brew install kubectl 

2.配置kubectl zsh自动补全

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:

代码语言:javascript
复制
source <(kubectl completion zsh)

If you have an alias for kubectl, you can extend shell completion to work with that alias:

代码语言:javascript
复制
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:

代码语言:javascript
复制
autoload -Uz compinit
compinit
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. mac下使用brew安装
  • 2.配置kubectl zsh自动补全
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档