Kubectl常用命令详解

栏目:汽车资讯  时间:2023-08-10
手机版

  NameShorthandDefaultUsageallow-missing-template-keystrueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.cluster-ipClusterIP to be assigned to the service. Leave empty to auto-allocate, or set to ‘None’ to create a headless service.container-portSynonym for --target-portdry-runfalseIf true, only print the object that would be sent, without sending it.external-ipAdditional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP. 用于接受服务的额外的外部IP地址(不被kubernetes管理)。如果这个IP被路由到一个节点,则这个服务处理被它产生的service IP接入外,还可以被这个IP接入。filenamef[]Filename, directory, or URL to files identifying the resource to expose a servicegeneratorservice/v2The name of the API generator to use. There are 2 generators: ‘service/v1’ and ‘service/v2’. The only difference between them is that service port in v1 is named ‘default’, while it is left unnamed in v2. Default is ‘service/v2’.labelslLabels to apply to the service created by this call.load-balancer-ipIP to assign to the Load Balancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).nameThe name for the newly created object.no-headersfalseWhen using the default or custom-column output format, don’t print headers (default print headers).outputoOutput format. One of: json|yaml|wide|name|custom-columns=…|custom-columns-file=…|go-template=…|go-template-file=…|jsonpath=…|jsonpath-file=… See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].output-versionDEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: ‘jobs.v1.batch/myjob’).overridesAn inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.portThe port that the service should serve on. Copied from the resource being exposed, if unspecifiedprotocolThe network protocol for the service to be created. Default is ‘TCP’.recordfalseRecord current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.save-configfalseIf true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.selectorA label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.)session-affinityIf non-empty, set the session affinity for the service to this; legal values: ‘None’, ‘ClientIP’show-allafalseWhen printing, show all resources (default hide terminated pods.)show-labelsfalseWhen printing, show all labels as the last column (default hide labels column)sort-byIf non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. ‘{.metadata.name}’). The field in the API resource specified by this JSONPath expression must be an integer or a string.target-portName or number for the port on the container that the service should direct traffic to. Optional.templateTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].typeType for this service: ClusterIP, NodePort, or LoadBalancer. Default is ‘ClusterIP’.

上一篇:诗经关雎十篇
下一篇:《研究生英语阅读教程》(基础级)第三版课文译文.pdf