安装krew
地址:https://krew.sigs.k8s.io/docs/user-guide/setup/install/
macOS/Linux
- Bash or ZSH shells
 
- 确保已安装git
2.执行如下命令进行下载和安装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/')" &&
  KREW="krew-${OS}_${ARCH}" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
  tar zxvf "${KREW}.tar.gz" &&
  ./"${KREW}" install krew
)
# 命令执行过程和结果
+ cd /tmp/tmp.mJPe00R4vD
++ uname
++ tr '[:upper:]' '[:lower:]'
+ OS=linux
++ uname -m
++ sed -e s/x86_64/amd64/ -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/'
+ ARCH=amd64
+ KREW=krew-linux_amd64
+ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-linux_amd64.tar.gz
+ tar zxvf krew-linux_amd64.tar.gz
./LICENSE
./krew-linux_amd64
+ ./krew-linux_amd64 install krew
Adding "default" plugin index from https://github.com/kubernetes-sigs/krew-index.git.
Updated the local copy of plugin index.
Installing plugin: krew
Installed plugin: krew
\
 | Use this plugin:
 |      kubectl krew
 | Documentation:
 |      https://krew.sigs.k8s.io/
 | Caveats:
 | \
 |  | krew is now installed! To start using kubectl plugins, you need to add
 |  | krew's installation directory to your PATH:
 |  |
 |  |   * macOS/Linux:
 |  |     - Add the following to your ~/.bashrc or ~/.zshrc:
 |  |         export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
 |  |     - Restart your shell.
 |  |
 |  |   * Windows: Add %USERPROFILE%\.krew\bin to your PATH environment variable
 |  |
 |  | To list krew commands and to get help, run:
 |  |   $ kubectl krew
 |  | For a full list of available plugins, run:
 |  |   $ kubectl krew search
 |  |
 |  | You can find documentation at
 |  |   https://krew.sigs.k8s.io/docs/user-guide/quickstart/.
 | /
/
3.根据命令执行结果,配置环境变量
vim ~/.bashrc
# 在末尾新增如下这行
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
4.退出当前shell重新打开,然后执行如下命令进行校验
# kubectl krew
krew is the kubectl plugin manager.
You can invoke krew through kubectl: "kubectl krew [command]..."
Usage:
  kubectl krew [command]
Available Commands:
  completion  generate the autocompletion script for the specified shell
  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.
# kubectl krew search
NAME                            DESCRIPTION                                         INSTALLED
access-matrix                   Show an RBAC access matrix for server resources     no
accurate                        Manage Accurate, a multi-tenancy controller         no
advise-policy                   Suggests PodSecurityPolicies and OPA Policies f...  no
advise-psp                      Suggests PodSecurityPolicies for cluster.           no
allctx                          Run commands on contexts in your kubeconfig         no
apparmor-manager                Manage AppArmor profiles for cluster.               no
assert                          Assert Kubernetes resources                         no
auth-proxy                      Authentication proxy to a pod or service            no
azad-proxy                      Generate and handle authentication for azad-kub...  no
bd-xray                         Run Black Duck Image Scans                          no
blame                           Show who edited resource fields.                    no
bulk-action                     Do bulk actions on Kubernetes resources.            no
ca-cert                         Print the PEM CA certificate of the current clu...  no
capture                         Triggers a Sysdig capture to troubleshoot the r...  no
cert-manager                    Manage cert-manager resources inside your cluster   no
change-ns                       View or change the current namespace via kubectl.   no
cilium                          Easily interact with Cilium agents.                 no
cluster-group                   Exec commands across a group of contexts.           no
clusternet                      Wrap multiple kubectl calls to Clusternet           no
cm                              Provides commands for OCM/MCE/ACM.                  no
config-cleanup                  Automatically clean up your kubeconfig              no
config-registry                 Switch between registered kubeconfigs               no
cost                            View cluster cost information                       no
creyaml                         Generate custom resource YAML manifest              no
ctx                             Switch between contexts in your kubeconfig          no
custom-cols                     A "kubectl get" replacement with customizable c...  no
cyclonus                        NetworkPolicy analysis tool suite                   no
datadog                         Manage the Datadog Operator                         no
datree                          Scan your cluster resources for misconfigurations   no
debug-shell                     Create pod with interactive kube-shell.             no
deprecations                    Checks for deprecated objects in a cluster          no
df-pv                           Show disk usage (like unix df) for persistent v...  no
direct-csi                      CSI driver to manage drives in k8s cluster as v...  no
directpv                        Deploys and manages the lifecycle of DirectPV C...  no
doctor                          Scans your cluster and reports anomalies.           no
duck                            List custom resources with ducktype support         no
edit-status                     Edit /status subresources of CRs                    no
eds                             Interact and manage ExtendedDaemonset resources     no
eksporter                       Export resources and removes a pre-defined set ...  no
emit-event                      Emit Kubernetes Events for the requested object     no
evict-pod                       Evicts the given pod                                no
example                         Prints out example manifest YAMLs                   no
exec-as                         Like kubectl exec, but offers a `user` flag to ...  no
exec-cronjob                    Run a CronJob immediately as Job                    no
explore                         A better kubectl explain with the fuzzy finder      no
fields                          Grep resources hierarchy by field name              no
flame                           Generate CPU flame graphs from pods                 no
fleet                           Shows config and resources of a fleet of clusters   no
flyte                           Monitor, launch and manage flyte executions         no
fuzzy                           Fuzzy and partial string search for kubectl         no
gadget                          Gadgets for debugging and introspecting apps        no
get-all                         Like `kubectl get all` but _really_ everything      no
gke-credentials                 Fetch credentials for GKE clusters                  no
gopass                          Imports secrets from gopass                         no
graph                           Visualize Kubernetes resources and relationships.   no
grep                            Filter Kubernetes resources by matching their n...  no
gs                              Handle custom resources with Giant Swarm            no
hlf                             Deploy and manage Hyperledger Fabric components     no
hns                             Manage hierarchical namespaces (part of HNC)        no
htpasswd                        Create nginx-ingress compatible basic-auth secrets  no
ice                             View configuration settings of containers insid...  no
iexec                           Interactive selection tool for `kubectl exec`       no
images                          Show container images used in the cluster.          no
ingress-nginx                   Interact with ingress-nginx                         no
ingress-rule                    Update Ingress rules via command line               no
ipick                           A kubectl wrapper for interactive resource sele...  no
istiolog                        Manipulate istio-proxy logging level without is...  no
janitor                         Lists objects in a problematic state                no
kadalu                          Manage Kadalu Operator, CSI and Storage pods        no
karbon                          Connect to Nutanix Karbon cluster                   no
karmada                         Manage clusters with Karmada federation.            no
konfig                          Merge, split or import kubeconfig files             no
krew                            Package manager for kubectl plugins.                yes
kruise                          Easily handle OpenKruise workloads                  no
ks                              Simple management of KubeSphere components          no
ktop                            A top tool to display workload metrics              no
kubesec-scan                    Scan Kubernetes resources with kubesec.io.          no
kudo                            Declaratively build, install, and run operators...  no
kuota-calc                      Calculate needed quota to perform rolling updates.  no
kurt                            Find what's restarting and why                      no
kuttl                           Declaratively run and test operators                no
kyverno                         Kyverno is a policy engine for kubernetes           no
lineage                         Display all dependent resources or resource dep...  no
match-name                      Match names of pods and other API objects           no
mc                              Run kubectl commands against multiple clusters ...  no
minio                           Deploy and manage MinIO Operator and Tenant(s)      no
moco                            Interact with MySQL operator MOCO.                  no
modify-secret                   modify secret with implicit base64 translations     no
mtail                           Tail logs from multiple pods matching label sel...  no
multiforward                    Port Forward to multiple Kubernetes Services        no
multinet                        Shows pods' network-status of multi-net-spec        no
neat                            Remove clutter from Kubernetes manifests to mak...  no
net-forward                     Proxy to arbitrary TCP services on a cluster ne...  no
node-admin                      List nodes and run privileged pod with chroot       no
node-restart                    Restart cluster nodes sequentially and gracefully   no
node-shell                      Spawn a root shell on a node via kubectl            no
np-viewer                       Network Policies rules viewer                       no
ns                              Switch between Kubernetes namespaces                no
nsenter                         Run shell command in Pod's namespace on the nod...  no
oidc-login                      Log in to the OpenID Connect provider               no
open-svc                        Open the Kubernetes URL(s) for the specified se...  no
openebs                         View and debug OpenEBS storage resources            no
operator                        Manage operators with Operator Lifecycle Manager    no
oulogin                         Login to a cluster via OpenUnison                   no
outdated                        Finds outdated container images running in a cl...  no
passman                         Store kubeconfig credentials in keychains or pa...  no
pexec                           Execute process with privileges in a pod            no
pod-dive                        Shows a pod's workload tree and info inside a node  no
pod-inspect                     Get all of a pod's details at a glance              no
pod-lens                        Show pod-related resources                          no
pod-logs                        Display a list of pods to get logs from             no
pod-shell                       Display a list of pods to execute a shell in        no
podevents                       Show events for pods                                no
popeye                          Scans your clusters for potential resource issues   no
preflight                       Executes application preflight tests in a cluster   no
profefe                         Gather and manage pprof profiles from running pods  no
promdump                        Dumps the head and persistent blocks of Prometh...  no
prompt                          Prompts for user confirmation when executing co...  no
prune-unused                    Prune unused resources                              no
psp-util                        Manage Pod Security Policy(PSP) and the related...  no
pv-migrate                      Migrate data across persistent volumes              no
pvmigrate                       Migrates PVs between StorageClasses                 no
rabbitmq                        Manage RabbitMQ clusters                            no
rbac-lookup                     Reverse lookup for RBAC                             no
rbac-tool                       Plugin to analyze RBAC permissions and generate...  no
rbac-view                       A tool to visualize your RBAC permissions.          no
realname-diff                   Diffs live and local resources ignoring Kustomi...  no
reap                            Delete unused Kubernetes resources.                 no
relay                           Drop-in "port-forward" replacement with UDP and...  no
reliably                        Surfaces reliability issues in Kubernetes           no
rename-pvc                      Rename a PersistentVolumeClaim (PVC)                no
resource-capacity               Provides an overview of resource requests, limi...  no
resource-snapshot               Prints a snapshot of nodes, pods and HPAs resou...  no
resource-versions               Print supported API resource versions               no
restart                         Restarts a pod with the given name                  no
rm-standalone-pods              Remove all pods without owner references            no
rolesum                         Summarize RBAC roles for subjects                   no
roll                            Rolling restart of all persistent pods in a nam...  no
rook-ceph                       Rook plugin for Ceph management                     no
schemahero                      Declarative database schema migrations via YAML     no
score                           Kubernetes static code analysis.                    no
secretdata                      Viewing decoded Secret data with search flags       no
service-tree                    Status for ingresses, services, and their backends  no
shovel                          Gather diagnostics for .NET Core applications       no
sick-pods                       Find and debug Pods that are "Not Ready"            no
skew                            Find if your cluster/kubectl version is skewed      no
slice                           Split a multi-YAML file into individual files.      no
snap                            Delete half of the pods in a namespace or cluster   no
sniff                           Start a remote packet capture on pods using tcp...  no
socks5-proxy                    SOCKS5 proxy to Services or Pods in the cluster     no
sort-manifests                  Sort manifest files in a proper order by Kind       no
split-yaml                      Split YAML output into one file per resource.       no
spy                             pod debugging tool for kubernetes clusters with...  no
sql                             Query the cluster via pseudo-SQL                    no
ssh-jump                        Access nodes or services using SSH jump Pod         no
sshd                            Run SSH server in a Pod                             no
ssm-secret                      Import/export secrets from/to AWS SSM param store   no
starboard                       Toolkit for finding risks in kubernetes resources   no
status                          Show status details of a given resource.            no
stern                           Multi pod and container log tailing                 no
strace                          Capture strace logs from a running workload         no
sudo                            Run Kubernetes commands impersonated as group s...  no
support-bundle                  Creates support bundles for off-cluster analysis    no
tail                            Stream logs from multiple pods and containers u...  no
tap                             Interactively proxy Kubernetes Services with ease   no
tmux-exec                       An exec multiplexer using Tmux                      no
topology                        Explore region topology for nodes or pods           no
trace                           Trace Kubernetes pods and nodes with system tools   no
tree                            Show a tree of object hierarchies through owner...  no
tunnel                          Reverse tunneling between cluster and your machine  no
unused-volumes                  List unused PVCs                                    no
vela                            Easily interact with KubeVela                       no
view-allocations                List allocations per resources, nodes, pods.        no
view-cert                       View certificate information stored in secrets      no
view-secret                     Decode Kubernetes secrets                           no
view-serviceaccount-kubeconfig  Show a kubeconfig setting to access the apiserv...  no
view-utilization                Shows cluster cpu and memory utilization            no
view-webhook                    Visualize your webhook configurations               no
viewnode                        Displays nodes with their pods and containers       no
virt                            Control KubeVirt virtual machines using virtctl     no
vpa-recommendation              Compare VPA recommendations to actual resources...  no
warp                            Sync and execute local files in Pod                 no
whisper-secret                  Create secrets with improved privacy                no
who-can                         Shows who has RBAC permissions to access Kubern...  no
whoami                          Show the subject that's currently authenticated...  no
												
											安装krew的更多相关文章
- k8s krew 插件管理工具
		
参考:https://github.com/kubernetes-sigs/krew https://int32bit.me/2019/12/05/%E5%88%86%E4%BA%AB%E5%87%A ...
 - kubectl插件管理工具krew
		
文章转载自:https://blog.51cto.com/loong576/2452592 一.k8s核心组件 Kubernetes 主要由以下几个核心组件组成: etcd 保存了整个集群的状态: a ...
 - 这些用来审计 Kubernetes RBAC 策略的方法你都见过吗?
		
原文链接:这些用来审计 Kubernetes RBAC 策略的方法你都见过吗? 认证与授权对任何安全系统来说都至关重要,Kubernetes 也不例外.即使我们不是安全工作人员,也需要了解我们的 Ku ...
 - 万字硬核干货!6大技巧,极速提升kubectl的生产力!
		
明晚8:30,k3s实战课程开启!将由Rancher研发总监带你畅游k3s与边缘AI的奇妙世界.课程内容完全由实际使用场景中总结而来,别错过啦~!访问以下链接即可传送到课程现场: http://z-m ...
 - 一文了解HAProxy主要特性
		
本文转自Rancher Labs 在Kubernetes中,Ingress对象定义了一些路由规则,这些规则规定如何将一个客户端请求路由到指定服务,该服务运行在你的集群中.这些规则可以考虑到输入的HTT ...
 - 调试 Ingress Nginx
		
由于 Ingress Nginx 是最受欢迎的 Ingress 控制器,因此接下来我们将介绍一些有关调试 ingress-nginx 的技巧. 调试 Ingress Nginx Ingress-ngi ...
 - krew插件安装
		
概念 Krew是kubectl插件的包管理工具.借助Krew,可以轻松地使用kubectl plugin:发现插件.安装和管理插件.使用类似apt.dnf或者brew. 对于kubectl用户:kre ...
 - kubectl 的插件管理工具krew
		
k8s的命令行工具kubectl 对于玩k8s 的人来说是必备工具.kubectl插件机制在Kubernetes 1.14宣布稳定,进入GA状态.kubectl的插件机制就是希望允许开发者以独立的二进 ...
 - k8s中安装rabbitmq集群
		
官方文档地址:https://www.rabbitmq.com/kubernetes/operator/quickstart-operator.html 要求 1.k8s版本要1.18及其以上 2.能 ...
 
随机推荐
- MyBatis 映射文件
			
Mybatis映射文件简介 1) MyBatis 的真正强大在于它的映射语句.由于它的异常强大,映射器的 XML 文件就显得相对简单.如果拿它跟具有相同功能的 JDBC 代码进行对比,你会立即发现省掉 ...
 - Linux配置Oracle JAVA环境
			
1.下载java jdk的安装包 #pwd /usr/local/src 2.解压二进制文件并设置软连接 # tar -xvf jdk-8u241-linux-x64.tar.gz # ln -sv ...
 - GitHub中Fork来的仓库如何进行双向更新
			
一.做点贡献 想对别人的某个仓库"做点贡献"怎么办? 1. Fork该仓库 首先Fork该仓库,本文以git-learn这个仓库为例 这样自己的账号下就会出现这样一个仓库 2. C ...
 - Mybatis源码解读-插件
			
插件允许对Mybatis的四大对象(Executor.ParameterHandler.ResultSetHandler.StatementHandler)进行拦截 问题 Mybatis插件的注册顺序 ...
 - MPI学习笔记(二):矩阵相乘的两种实现方法
			
mpi矩阵乘法(C=αAB+βC) 最近领导让把之前安装的软件lapack.blas里的dgemm运算提取出来独立作为一套程序,然后把这段程序改为并行的,并测试一下进程规模扩展到128时的并行效率. ...
 - Redis 哈希Hash底层数据结构
			
1. Redis 底层数据结构 Redis数据库就像是一个哈希表,首先对key进行哈希运算得到哈希值再取模得到一个下标,每个元素是一个节点,节点之间形成链表.这感觉有点像Java中的HashMap. ...
 - 理解JavaScript中的window对象
			
前言 每个JavaScript环境都有一个全局对象(global object).在全局范围内创建的任何变量实际上都是这个对象的属性,而任何函数都是它的方法.在浏览器环境中,全局对象是window对象 ...
 - 万答#19,MySQL可以禁用MyISAM引擎吗?
			
GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. MyISAM的适用场景越来越少了. 随着MySQL 8.0的推出,系统表已经全面采用InnoDB引擎,不再需要MyISAM ...
 - mybatis 07: sql标签中 "#{}" 和 "${}" 的作用和比较
			
"#{}"占位符 作用 传参大部分使用"#{}",在数据库底层使用的是:PreparedStatement预编译处理对象 数据库底层被解析为"?&qu ...
 - java学习第一天.day02
			
整数类型常量 整数类型的常量JVM默认使用 int 类型来存储 小数类型类型 小数类型的常量JVM默认使用 double 类型来存储 . ASCII表 A在码表的顺序是65,a在码表的顺序是97