1、查看kubectl命令帮助
kubectl –h
1 kubectl controls the Kubernetes cluster manager. 2 Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/ 3 Basic Commands (Beginner): #基本命令集,适合新手 4 create Create a resource from a file or from stdin. 5 expose 使用 replication controller, service, deployment 或者 pod 并暴露它作为一个 新的 6 Kubernetes Service 7 run 在集群中运行一个指定的镜像 8 set 为 objects 设置一个指定的特征 9 run-container 在集群中运行一个指定的镜像. This command is deprecated, use "run" instead 10 11 Basic Commands (Intermediate): #基本命令集,适合有一定基础的人 12 get 显示一个或更多 resources 13 explain 查看资源的文档 14 edit 在服务器上编辑一个资源 15 delete Delete resources by filenames, stdin, resources and names, or by resources and label selector 16 17 Deploy Commands: #发布相关的命令集 18 rollout Manage the rollout of a resource 19 rolling-update 完成指定的 ReplicationController 的滚动升级 20 scale 为 Deployment, ReplicaSet, Replication Controller 或者 Job 设置一个新的副本数量 21 autoscale 自动调整一个 Deployment, ReplicaSet, 或者 ReplicationController 的副本数量 22 23 Cluster Management Commands: #集群管理相关的命令集 24 certificate 修改 certificate 资源. 25 cluster-info 显示集群信息 26 top Display Resource (CPU/Memory/Storage) usage. 27 cordon 标记 node 为 unschedulable 28 uncordon 标记 node 为 schedulable 29 drain Drain node in preparation for maintenance 30 taint 更新一个或者多个 node 上的 taints 31 32 Troubleshooting and Debugging Commands: #故障检测及调试相关命令集 33 describe 显示一个指定 resource 或者 group 的 resources 详情 34 logs 输出容器在 pod 中的日志 35 attach Attach 到一个运行中的 container 36 exec 在一个 container 中执行一个命令 37 port-forward Forward one or more local ports to a pod 38 proxy 运行一个 proxy 到 Kubernetes API server 39 cp 复制 files 和 directories 到 containers 和从容器中复制 files 和 directories. 40 auth Inspect authorization 41 42 Advanced Commands: #高级命令集 43 apply 通过文件名或标准输入流(stdin)对资源进行配置 44 patch 使用 strategic merge patch 更新一个资源的 field(s) 45 replace 通过 filename 或者 stdin替换一个资源 46 convert 在不同的 API versions 转换配置文件 47 48 Settings Commands: #设置相关的命令集 49 label 更新在这个资源上的 labels 50 annotate 更新一个资源的注解 51 completion Output shell completion code for the specified shell (bash or zsh) 52 53 Other Commands: #其他命令集 54 api-versions Print the supported API versions on the server, in the form of "group/version" 55 config 修改 kubeconfig 文件 56 help Help about any command 57 plugin Runs a command-line plugin 58 version 输出 client 和 server 的版本信息 59 60 Usage: #使用格式 61 kubectl [flags] [options] 62 63 Use "kubectl <command> --help" for more information about a given command. #各个子命令如何获取命令帮助 64 Use "kubectl options" for a list of global command-line options (applies to all commands). #查看命令的通用选项(所有命令) 65