参考

Kubernetes v1.13 版本的文档已不再维护。您现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本。

Edit This Page

kubectl

kubectl 用来控制 Kubernetes 集群管理器

摘要

kubectl 用来控制 Kubernetes 集群管理器。

更多信息参见 /docs/reference/kubectl/overview/

kubectl [flags]

Options

      --alsologtostderr                  log to standard error as well as files
      --as string                        Username to impersonate for the operation
      --as-group stringArray             Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --cache-dir string                 Default HTTP cache directory (default "/home/username/.kube/http-cache")
      --certificate-authority string     Path to a cert file for the certificate authority
      --client-certificate string        Path to a client certificate file for TLS
      --client-key string                Path to a client key file for TLS
      --cluster string                   The name of the kubeconfig cluster to use
      --context string                   The name of the kubeconfig context to use
  -h, --help                             help for kubectl
      --insecure-skip-tls-verify         If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
      --kubeconfig string                Path to the kubeconfig file to use for CLI requests.
      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log-dir string                   If non-empty, write log files in this directory
      --logtostderr                      log to standard error instead of files
      --match-server-version             Require server version to match client version
  -n, --namespace string                 If present, the namespace scope for this CLI request
      --request-timeout string           The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
  -s, --server string                    The address and port of the Kubernetes API server
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
      --token string                     Bearer token for authentication to the API server
      --user string                      The name of the kubeconfig user to use
  -v, --v Level                          log level for V logs
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

–>

选项

      --alsologtostderr                  同时输出日志到标准错误控制台和文件
      --as string                        以指定用户执行操作
	  --as-group stringArray             模拟操作的组,可以使用这个标识来指定多个组。
      --cache-dir string                 默认 HTTP 缓存目录(默认值 "/home/username/.kube/http-cache" )
      --certificate-authority string     用于进行认证授权的 .cert 文件路径
      --client-certificate string        TLS 使用的客户端证书路径
      --client-key string                TLS 使用的客户端密钥文件路径
      --cluster string                   指定要使用的 kubeconfig 文件中集群名
      --context string                   指定要使用的 kubeconfig 文件中上下文
  -h, --help                             kubectl 帮助
      --insecure-skip-tls-verify         值为 true,则不会检查服务器的证书的有效性。 这将使您的HTTPS连接不安全
      --kubeconfig string                CLI 请求使用的 kubeconfig 配置文件路径。
      --log-backtrace-at traceLocation   当日志长度超出规定的行数时,忽略堆栈信息(默认值:0)
      --log-dir string                   如果不为空,则将日志文件写入此目录
      --logtostderr                      日志输出到标准错误控制台而不输出到文件
      --match-server-version             要求客户端版本和服务端版本相匹配
  -n, --namespace string                 如果存在,CLI 请求将使用此命名空间
      --request-timeout string           放弃一个简单服务请求前的等待时间,非零值需要包含相应时间单位(例如:1s, 2m, 3h)。零值则认为不做超时请求。 (默认值 "0")
  -s, --server string                    Kubernetes API server 的地址和端口
      --stderrthreshold severity         等于或高于此阈值的日志将输出标准错误控制台(默认值2)
      --token string                     用于 API server 进行身份认证的承载令牌
      --user string                      指定使用的 kubeconfig 配置文件中的用户名
  -v, --v Level                          指定输出日志的日志级别
      --vmodule moduleSpec               指定输出日志的模块,格式如下:pattern=N,使用逗号分隔

接下来看

######2018年6月16日,通过spf13/cobra自动生成

反馈