kubectl Plugins

发布时间: 更新时间: 总字数:200 阅读时间:1m 作者: IP上海 分享 网址

k8s kubectl plugins - krew 安装部署

install

Linux/Mac

  • install krew
(
  set -x; cd "$(mktemp -d)" &&
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
  tar zxvf krew.tar.gz &&
  KREW=./krew-"${OS}_${ARCH}" &&
  "$KREW" install krew
)
  • set env

.bashrc or .zshrc中添加

export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
  • test
# kubectl krew
krew is the kubectl plugin manager.
You can invoke krew through kubectl: "kubectl krew [command]..."

Usage:
  kubectl krew [command]

Available Commands:
  help        Help about any command
  index       Manage custom plugin indexes
  info        Show information about an available plugin
  install     Install kubectl plugins
  list        List installed kubectl plugins
  search      Discover kubectl plugins
  uninstall   Uninstall plugins
  update      Update the local copy of the plugin index
  upgrade     Upgrade installed plugins to newer versions
  version     Show krew version and diagnostics

Flags:
  -h, --help      help for krew
  -v, --v Level   number for the log level verbosity

Use "kubectl krew [command] --help" for more information about a command.

Mac

brew install kubectx

use

kubectl krew update
kubectl krew search
kubectl krew install whoami
kubectl whoami
kubectl krew uninstall whoami

参考

  1. https://krew.sigs.k8s.io/
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数