Kubernetes:11.kubectl 命令概述

环境

[09:42:02 root@ceshi-01 ~ $]cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

[09:41:17 root@ceshi-01 ~ $]kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:23:26Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:15:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

语法

[22:46:01 root@ceshi-01 ~ $]kubectl 
kubectl controls the Kubernetes cluster manager.
Kubernetes 集群管理工具

 Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/
 更多详情

Basic Commands (Beginner):基础命令(初级)
  create         Create a resource from a file or from stdin.
                 从文件或标准输入创建资源
  expose         使用 replication controller, service, deployment 或者 pod 并暴露它作为一个 新的
                 将资源暴露为新的Kubernetes Service。
Kubernetes Service
  run            在集群中运行一个指定的镜像
  set            为 objects 设置一个指定的特征

Basic Commands (Intermediate):基础命令(中级)
  explain        查看资源的文档
  get            显示一个或更多 resources
  edit           在服务器上编辑一个资源
  delete         Delete resources by filenames, stdin, resources and names, or by resources and label selector
                 通过配置文件名、stdin、资源名称或label选择器来删除资源。

Deploy Commands:发布命令
  rollout        Manage the rollout of a resource
                 管理资源的部署
  scale          为 Deployment, ReplicaSet, Replication Controller 或者 Job 设置一个新的副本数量
  autoscale      自动调整一个 Deployment, ReplicaSet, 或者 ReplicationController 的副本数量

Cluster Management Commands:集群管理命令
  certificate    修改 certificate 资源.
  cluster-info   显示集群信息
  top            Display Resource (CPU/Memory/Storage) usage.
                 显示资源使用情况(CPU/内存/存储)
  cordon         标记 node 为 不可调度
  uncordon       标记 node 为 可调度
  drain          Drain node in preparation for maintenance
                 安全驱逐节点上所有的 pod
  taint          更新一个或者多个 node 上的污点

Troubleshooting and Debugging Commands:故障排除和调试命令
  describe       显示一个指定 resource 或者 group 的 resources 详情
  logs           输出容器在 pod 中的日志
  attach         连接到一个运行中的 container
  exec           在一个容器中执行一个命令
  port-forward   Forward one or more local ports to a pod
                 将一个或多个本地端口转发到 pod
  proxy          运行一个 proxy 到 Kubernetes API server
  cp             复制 files 和 directories 到 containers 和从容器中复制 files 和 directories.
                 将文件或目录从本地复制到容器或者从容器复制到本地
  auth           Inspect authorization
                 检查授权

Advanced Commands:高级命令
  diff           Diff live version against would-be applied version
                 对比将要应用的版本和现有版本的差异
  apply          通过文件名或标准输入流(stdin)对资源进行配置
  patch          使用 strategic merge patch 更新一个资源的 field(s)
                 使用策略性合并补丁更新一个 Deployment
  replace        通过 filename 或者 stdin替换一个资源
  wait           Experimental: Wait for a specific condition on one or many resources.
                 实验:在一个或多个资源上等待特定条件
  convert        在不同的 API versions 转换配置文件
  kustomize      Build a kustomization target from a directory or a remote url.
                 从目录或远程 RUL 构建 kustomization 目标

Settings Commands:设置命令
  label          更新在这个资源上的 labels
  annotate       更新一个资源的注解
  completion     Output shell completion code for the specified shell (bash or zsh)
                 设置命令自动补全

Other Commands:其他命令
  api-resources  Print the supported API resources on the server
                 打印支持的 API 资源
  api-versions   Print the supported API versions on the server, in the form of "group/version"
                 以 "group/version" 的形式打印支持的 API 版本
  config         修改 kubeconfig 文件
  plugin         Provides utilities for interacting with plugins.
                 
  version        输出 client 和 server 的版本信息

Usage:用法
  kubectl [flags] [options]

Use "kubectl  --help" for more information about a given command.
有关指定命令的更多详情请使用:kubectl  --help
Use "kubectl options" for a list of global command-line options (applies to all commands).
使用 "kubectl options" 来获取全局命令选项列表    

你可能感兴趣的:(Kubernetes:11.kubectl 命令概述)