diff --git a/static/docs/reference/generated/kubectl/kubectl-commands.html b/static/docs/reference/generated/kubectl/kubectl-commands.html index 97b6efc8e8..c060bb0cef 100644 --- a/static/docs/reference/generated/kubectl/kubectl-commands.html +++ b/static/docs/reference/generated/kubectl/kubectl-commands.html @@ -11,7 +11,7 @@ - +

GETTING STARTED

@@ -25,1289 +25,6 @@ running on your cluster.

WORKING WITH APPS section to inspect them.


-

run

-
-

Start a single instance of nginx.

-
-
kubectl run nginx --image=nginx
-
-
-

Start a single instance of hazelcast and let the container expose port 5701 .

-
-
kubectl run hazelcast --image=hazelcast --port=5701
-
-
-

Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.

-
-
kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
-
-
-

Start a single instance of hazelcast and set labels "app=hazelcast" and "env=prod" in the container.

-
-
kubectl run hazelcast --image=nginx --labels="app=hazelcast,env=prod"
-
-
-

Start a replicated instance of nginx.

-
-
kubectl run nginx --image=nginx --replicas=5
-
-
-

Dry run. Print the corresponding API objects without creating them.

-
-
kubectl run nginx --image=nginx --dry-run
-
-
-

Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON.

-
-
kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
-
-
-

Start a pod of busybox and keep it in the foreground, don't restart it if it exits.

-
-
kubectl run -i -t busybox --image=busybox --restart=Never
-
-
-

Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command.

-
-
kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
-
-
-

Start the nginx container using a different command and custom arguments.

-
-
kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
-
-
-

Start the perl container to compute π to 2000 places and print it out.

-
-
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
-
-
-

Start the cron job to compute π to 2000 places and print it out every 5 minutes.

-
-
kubectl run pi --schedule="0/5 * * * ?" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
-
-

Create and run a particular image, possibly replicated.

-

Creates a deployment or job to manage the created container(s).

-

Usage

-

$ run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...]

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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.
attachfalseIf true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.
commandfalseIf true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.
dry-runfalseIf true, only print the object that would be sent, without sending it.
env[]Environment variables to set in the container
exposefalseIf true, a public, external service is created for the container(s) which are run
generatorThe name of the API generator to use, see http://kubernetes.io/docs/user-guide/kubectl-conventions/#generators for a list.
hostport-1The host port mapping for the container port. To demonstrate a single-machine container.
imageThe image for the container to run.
image-pull-policyThe image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
labelslComma separated labels to apply to the pod(s). Will override previous values.
leave-stdin-openfalseIf the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.
limitsThe resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi'. Note that server side components may assign limits depending on the server configuration, such as limit ranges.
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.
pod-running-timeout1m0sThe length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running
portThe port that this container exposes. If --expose is true, this is also the port used by the service that is created.
quietfalseIf true, suppress prompt messages.
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.
replicasr1Number of replicas to create for this container. Default is 1.
requestsThe resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.
restartAlwaysThe restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to 'Always' a deployment is created, if set to 'OnFailure' a job is created, if set to 'Never', a regular pod is created. For the latter two --replicas must be 1. Default 'Always', for CronJobs Never.
rmfalseIf true, delete resources created in this command for attached containers.
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.
scheduleA schedule in the Cron format the job should be run with.
service-generatorservice/v2The name of the generator to use for creating a service. Only used if --expose is true
service-overridesAn inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.
serviceaccountService account to set in the pod spec
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
stdinifalseKeep stdin open on the container(s) in the pod, even if nothing is attached.
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].
ttytfalseAllocated a TTY for each container in the pod.
-
-

run-container

-
-

Start a single instance of nginx.

-
-
kubectl run nginx --image=nginx
-
-
-

Start a single instance of hazelcast and let the container expose port 5701 .

-
-
kubectl run hazelcast --image=hazelcast --port=5701
-
-
-

Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.

-
-
kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
-
-
-

Start a single instance of hazelcast and set labels "app=hazelcast" and "env=prod" in the container.

-
-
kubectl run hazelcast --image=nginx --labels="app=hazelcast,env=prod"
-
-
-

Start a replicated instance of nginx.

-
-
kubectl run nginx --image=nginx --replicas=5
-
-
-

Dry run. Print the corresponding API objects without creating them.

-
-
kubectl run nginx --image=nginx --dry-run
-
-
-

Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON.

-
-
kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
-
-
-

Start a pod of busybox and keep it in the foreground, don't restart it if it exits.

-
-
kubectl run -i -t busybox --image=busybox --restart=Never
-
-
-

Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command.

-
-
kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
-
-
-

Start the nginx container using a different command and custom arguments.

-
-
kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
-
-
-

Start the perl container to compute π to 2000 places and print it out.

-
-
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
-
-
-

Start the cron job to compute π to 2000 places and print it out every 5 minutes.

-
-
kubectl run pi --schedule="0/5 * * * ?" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
-
-

Create and run a particular image, possibly replicated.

-

Creates a deployment or job to manage the created container(s).

-

Usage

-

$ run-container

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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.
attachfalseIf true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.
commandfalseIf true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.
dry-runfalseIf true, only print the object that would be sent, without sending it.
env[]Environment variables to set in the container
exposefalseIf true, a public, external service is created for the container(s) which are run
generatorThe name of the API generator to use, see http://kubernetes.io/docs/user-guide/kubectl-conventions/#generators for a list.
hostport-1The host port mapping for the container port. To demonstrate a single-machine container.
imageThe image for the container to run.
image-pull-policyThe image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
labelslComma separated labels to apply to the pod(s). Will override previous values.
leave-stdin-openfalseIf the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.
limitsThe resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi'. Note that server side components may assign limits depending on the server configuration, such as limit ranges.
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.
pod-running-timeout1m0sThe length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running
portThe port that this container exposes. If --expose is true, this is also the port used by the service that is created.
quietfalseIf true, suppress prompt messages.
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.
replicasr1Number of replicas to create for this container. Default is 1.
requestsThe resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.
restartAlwaysThe restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to 'Always' a deployment is created, if set to 'OnFailure' a job is created, if set to 'Never', a regular pod is created. For the latter two --replicas must be 1. Default 'Always', for CronJobs Never.
rmfalseIf true, delete resources created in this command for attached containers.
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.
scheduleA schedule in the Cron format the job should be run with.
service-generatorservice/v2The name of the generator to use for creating a service. Only used if --expose is true
service-overridesAn inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.
serviceaccountService account to set in the pod spec
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
stdinifalseKeep stdin open on the container(s) in the pod, even if nothing is attached.
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].
ttytfalseAllocated a TTY for each container in the pod.
-
-

expose

-
-

Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000.

-
-
kubectl expose rc nginx --port=80 --target-port=8000
-
-
-

Create a service for a replication controller identified by type and name specified in "nginx-controller.yaml", which serves on port 80 and connects to the containers on port 8000.

-
-
kubectl expose -f nginx-controller.yaml --port=80 --target-port=8000
-
-
-

Create a service for a pod valid-pod, which serves on port 444 with the name "frontend"

-
-
kubectl expose pod valid-pod --port=444 --name=frontend
-
-
-

Create a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx-https"

-
-
kubectl expose service nginx --port=443 --target-port=8443 --name=nginx-https
-
-
-

Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video-stream'.

-
-
kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
-
-
-

Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000.

-
-
kubectl expose rs nginx --port=80 --target-port=8000
-
-
-

Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000.

-
-
kubectl expose deployment nginx --port=80 --target-port=8000
-
-

Expose a resource as a new Kubernetes service.

-

Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the specified port. A deployment or replica set will be exposed as a service only if its selector is convertible to a selector that service supports, i.e. when the selector contains only the matchLabels component. Note that if no port is specified via --port and the exposed resource has multiple ports, all will be re-used by the new service. Also if no labels are specified, the new service will re-use the labels from the resource it exposes.

-

Possible resources include (case insensitive):

-

pod (po), service (svc), replicationcontroller (rc), deployment (deploy), replicaset (rs)

-

Usage

-

$ expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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-port
dry-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.
filenamef[]Filename, directory, or URL to files identifying the resource to expose a service
generatorservice/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 LoadBalancer. 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 unspecified
protocolThe 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-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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, LoadBalancer, or ExternalName. Default is 'ClusterIP'.
-

APP MANAGEMENT

-

This section contains commands for creating, updating, deleting, and -viewing your workloads in a Kubernetes cluster.

-
-

annotate

-
-

Update pod 'foo' with the annotation 'description' and the value 'my frontend'. # If the same annotation is set multiple times, only the last value will be applied

-
-
kubectl annotate pods foo description='my frontend'
-
-
-

Update a pod identified by type and name in "pod.json"

-
-
kubectl annotate -f pod.json description='my frontend'
-
-
-

Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value.

-
-
kubectl annotate --overwrite pods foo description='my frontend running nginx'
-
-
-

Update all pods in the namespace

-
-
kubectl annotate pods --all description='my frontend running nginx'
-
-
-

Update pod 'foo' only if the resource is unchanged from version 1.

-
-
kubectl annotate pods foo description='my frontend running nginx' --resource-version=1
-
-
-

Update pod 'foo' by removing an annotation named 'description' if it exists. # Does not require the --overwrite flag.

-
-
kubectl annotate pods foo description-
-
-

Update the annotations on one or more resources

-

All Kubernetes objects support the ability to store additional data with the object as annotations. Annotations are key/value pairs that can be larger than labels and include arbitrary string values such as structured JSON. Tools and system extensions may use annotations to store their own data.

-

Attempting to set an annotation that already exists will fail unless --overwrite is set. If --resource-version is specified and does not match the current resource version on the server the command will fail.

-

Valid resource types include:

- -

Usage

-

$ annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allfalseSelect all resources, including uninitialized ones, in the namespace of the specified resource types.
allow-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.
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename, directory, or URL to files identifying the resource to update the annotation
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
localfalseIf true, annotation will NOT contact api-server but run locally.
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').
overwritefalseIf true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.
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.
resource-versionIf non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.
selectorlSelector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
-
-

autoscale

-
-

Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used:

-
-
kubectl autoscale deployment foo --min=2 --max=10
-
-
-

Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:

-
-
kubectl autoscale rc foo --max=5 --cpu-percent=80
-
-

Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster.

-

Looks up a Deployment, ReplicaSet, or ReplicationController by name and creates an autoscaler that uses the given resource as a reference. An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.

-

Usage

-

$ autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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.
cpu-percent-1The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, a default autoscaling policy will be used.
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename, directory, or URL to files identifying the resource to autoscale.
generatorhorizontalpodautoscaler/v1The name of the API generator to use. Currently there is only 1 generator.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
max-1The upper limit for the number of pods that can be set by the autoscaler. Required.
min-1The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.
nameThe name for the newly created object. If not specified, the name of the input resource will be used.
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').
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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
-
-

convert

-
-

Convert 'pod.yaml' to latest version and print to stdout.

-
-
kubectl convert -f pod.yaml
-
-
-

Convert the live state of the resource specified by 'pod.yaml' to the latest version # and print to stdout in JSON format.

-
-
kubectl convert -f pod.yaml --local -o json
-
-
-

Convert all files under current directory to latest version and create them all.

-
-
kubectl convert -f . | kubectl create -f -
-
-

Convert config files between different API versions. Both YAML and JSON formats are accepted.

-

The command takes filename, directory, or URL as input, and convert it into format of version specified by --output-version flag. If target version is not specified or not supported, convert to latest version.

-

The default output will be printed to stdout in YAML format. One can use -o option to change to output destination.

-

Usage

-

$ convert -f FILENAME

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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.
filenamef[]Filename, directory, or URL to files to need to get converted.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
localtrueIf true, convert will NOT try to contact api-server but run locally.
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-versionOutput the formatted object with the given group version (for ex: 'extensions/v1beta1').)
recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
validatetrueIf true, use a schema to validate the input before sending it
-

create

Create a pod using the data in pod.json.

@@ -1320,9 +37,9 @@ viewing your workloads in a Kubernetes cluster.

cat pod.json | kubectl create -f -
 
-

Edit the data in docker-registry.yaml in JSON using the v1 API format then create the resource using the edited data.

+

Edit the data in docker-registry.yaml in JSON then create the resource using the edited data.

-
kubectl create -f docker-registry.yaml --edit --output-version=v1 -o json
+
kubectl create -f docker-registry.yaml --edit -o json
 

Create a resource from a file or from stdin.

JSON and YAML formats are accepted.

@@ -1364,30 +81,12 @@ viewing your workloads in a Kubernetes cluster.

Filename, directory, or URL to files to use to create the resource -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - raw @@ -1418,24 +117,6 @@ viewing your workloads in a Kubernetes cluster.

Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - template @@ -1465,7 +146,7 @@ viewing your workloads in a Kubernetes cluster.

Create a ClusterRole named "pod-reader" with ResourceName specified

-
kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod --resource-name=anotherpod
+
kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
 

Create a ClusterRole named "foo" with API Group specified

@@ -1482,6 +163,11 @@ viewing your workloads in a Kubernetes cluster.

kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*
 
+
+

Create a ClusterRole name "monitoring" with AggregationRule specified

+
+
kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"
+

Create a ClusterRole.

Usage

$ clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]

@@ -1497,6 +183,12 @@ viewing your workloads in a Kubernetes cluster.

+aggregation-rule + + +An aggregation label selector for combining ClusterRoles. + + allow-missing-template-keys true @@ -1509,12 +201,6 @@ viewing your workloads in a Kubernetes cluster.

If true, only print the object that would be sent, without sending it. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - non-resource-url [] @@ -1527,12 +213,6 @@ viewing your workloads in a Kubernetes cluster.

Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - resource [] @@ -1551,24 +231,6 @@ viewing your workloads in a Kubernetes cluster.

If 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. -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - template @@ -1640,24 +302,12 @@ viewing your workloads in a Kubernetes cluster.

Groups to bind to the role -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - save-config false @@ -1670,24 +320,6 @@ viewing your workloads in a Kubernetes cluster.

Service accounts to bind to the role, in the format : -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - template @@ -1788,48 +420,18 @@ viewing your workloads in a Kubernetes cluster.

The name of the API generator to use. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - save-config false If 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. -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - template @@ -1879,7 +481,7 @@ viewing your workloads in a Kubernetes cluster.

generator -deployment-basic/v1beta1 + The name of the API generator to use. @@ -1889,48 +491,18 @@ viewing your workloads in a Kubernetes cluster.

Image name to run. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - save-config false If 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. -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - template @@ -1949,11 +521,11 @@ viewing your workloads in a Kubernetes cluster.

Create a job from a CronJob named "a-cronjob"

-
kubectl create job --from=cronjob/a-cronjob
+
kubectl create job test-job --from=cronjob/a-cronjob
 

Create a job with the specified name.

Usage

-

$ job NAME [--from-cronjob=CRONJOB]

+

$ job NAME [--from=CRONJOB]

Flags

@@ -1972,54 +544,30 @@ viewing your workloads in a Kubernetes cluster.

+ + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2073,48 +621,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2185,24 +703,12 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - @@ -2215,24 +721,6 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - @@ -2303,48 +791,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2415,24 +873,12 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - @@ -2445,24 +891,6 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - @@ -2486,7 +914,7 @@ viewing your workloads in a Kubernetes cluster.

Create a Role named "pod-reader" with ResourceName specified

-
kubectl create role pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod --resource-name=anotherpod
+
kubectl create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
 

Create a Role named "foo" with API Group specified

@@ -2525,24 +953,12 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - @@ -2561,24 +977,6 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - @@ -2650,24 +1048,12 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - @@ -2686,24 +1072,6 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - @@ -2729,12 +1097,14 @@ viewing your workloads in a Kubernetes cluster.

kubectl create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
 
-

Create a new secret for use with Docker registries.

-

Dockercfg secrets are used to authenticate against Docker registries.

-

When using the Docker command line to push images, you can authenticate to a given registry by running: '$ docker login DOCKER REGISTRY SERVER --username=DOCKER USER --password=DOCKER PASSWORD --email=DOCKER _EMAIL'.

-

That produces a ~/.dockercfg file that is used by subsequent 'docker push' and 'docker pull' commands to

-

authenticate to the registry. The email address is optional.

-

When creating applications, you may have a Docker registry that requires authentication. In order for the nodes to pull images on your behalf, they have to have the credentials. You can provide this information by creating a dockercfg secret and attaching it to your service account.

+

Create a new secret for use with Docker registries.

+

Dockercfg secrets are used to authenticate against Docker registries.

+

When using the Docker command line to push images, you can authenticate to a given registry by running: + '$ docker login DOCKER_REGISTRY_SERVER --username=DOCKER_USER --password=DOCKER_PASSWORD --email=DOCKER_EMAIL'.

+

That produces a ~/.dockercfg file that is used by subsequent 'docker push' and 'docker pull' commands to authenticate to the registry. The email address is optional.

+

When creating applications, you may have a Docker registry that requires authentication. In order for the + nodes to pull images on your behalf, they have to have the credentials. You can provide this information + by creating a dockercfg secret and attaching it to your service account.

Usage

$ docker-registry NAME --docker-username=user --docker-password=password --docker-email=email [--docker-server=string] [--from-literal=key1=value1] [--dry-run]

Flags

@@ -2791,60 +1161,30 @@ viewing your workloads in a Kubernetes cluster.

+ + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2945,48 +1285,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3065,48 +1375,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3176,48 +1456,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3284,48 +1534,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3385,48 +1605,18 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3486,12 +1676,6 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - @@ -3504,36 +1688,12 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - @@ -3593,10 +1753,149 @@ viewing your workloads in a Kubernetes cluster.

- + + + + + + + + + + + + + + + + + + + - + + + +
If 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.
dry-runfalseIf true, only print the object that would be sent, without sending it.
from The name of the resource to create a Job from (only cronjob is supported).
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template The minimum number or percentage of available pods this budget requires.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false A label selector to use for this budget. Only equality-based selector requirements are supported.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template global-default specifies whether this PriorityClass should be considered as the default priority.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template A comma-delimited set of resource=quantity pairs that define a hard limit.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false A comma-delimited set of quota scopes that must all match each object tracked by the quota.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template If true, only print the object that would be sent, without sending it.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
resource []If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template Groups to bind to the role
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
role Service accounts to bind to the role, in the format :
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template If true, only print the object that would be sent, without sending it.
from-file[]Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will iterate each named file in the directory that is a valid secret key.
generator secret-for-docker-registry/v1 The name of the API generator to use.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template Path to private key associated with given certificate.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
template The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
tcp []The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
tcp []The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
output o Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
tcp []The name of the API generator to use.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
node-port 0Output 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').
save-config false If 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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
tcp []The name of the API generator to use.
include-extended-apisoutputoOutput 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].
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.
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].
validate trueIf true, include definitions of new APIs via calls to the API server. [default true] If true, use a schema to validate the input before sending it
+
+

get

+
+

List all pods in ps output format.

+
+
kubectl get pods
+
+
+

List all pods in ps output format with more information (such as node name).

+
+
kubectl get pods -o wide
+
+
+

List a single replication controller with specified NAME in ps output format.

+
+
kubectl get replicationcontroller web
+
+
+

List deployments in JSON output format, in the "v1" version of the "apps" API group:

+
+
kubectl get deployments.v1.apps -o json
+
+
+

List a single pod in JSON output format.

+
+
kubectl get -o json pod web-pod-13je7
+
+
+

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

+
+
kubectl get -f pod.yaml -o json
+
+
+

Return only the phase value of the specified pod.

+
+
kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}}
+
+
+

List all replication controllers and services together in ps output format.

+
+
kubectl get rc,services
+
+
+

List one or more resources by their type and names.

+
+
kubectl get rc/web service/frontend pods/web-pod-13je7
+
+

Display one or many resources

+

Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current namespace unless you pass --all-namespaces.

+

Uninitialized objects are not shown unless --include-uninitialized is passed.

+

By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.

+

Use "kubectl api-resources" for a complete list of supported resources.

+

Usage

+

$ get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3611,16 +1910,28 @@ viewing your workloads in a Kubernetes cluster.

- + - + - - + + - + + + + + + + + + + + + + @@ -3629,6 +1940,12 @@ viewing your workloads in a Kubernetes cluster.

+ + + + + + @@ -3647,10 +1964,493 @@ viewing your workloads in a Kubernetes cluster.

- + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
all-namespacesfalseIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
allow-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.
chunk-size500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
exportfalseIf true, use 'export' for the resources. Exported resources are stripped of cluster-specific information.
field-selectorSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
filenamef[]Filename, directory, or URL to files identifying the resource to get from a server.
ignore-not-foundfalseIf the requested object does not exist the command will return exit code 0.
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
label-columnsL[]Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
no-headers Output 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-versionraw DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). Raw URI to request from the server. Uses the transport specified by the kubeconfig file.
save-configrecursiveR falseIf 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. Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
selectorlSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
server-printtrueIf true, have the server return the appropriate table output. Supports extension APIs and CRDs.
show-all When printing, show all resources (default show all pods including terminated one.)
show-kindfalseIf present, list the resource type for the requested object(s).
show-labels false Template 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].
validateuse-openapi-print-columnsfalseIf true, use x-kubernetes-print-column metadata (if present) from the OpenAPI schema for displaying a resource.
watchwfalseAfter listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
watch-onlyfalseWatch for changes to the requested object(s), without listing/getting first.
+
+

run

+
+

Start a single instance of nginx.

+
+
kubectl run nginx --image=nginx
+
+
+

Start a single instance of hazelcast and let the container expose port 5701 .

+
+
kubectl run hazelcast --image=hazelcast --port=5701
+
+
+

Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.

+
+
kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
+
+
+

Start a single instance of hazelcast and set labels "app=hazelcast" and "env=prod" in the container.

+
+
kubectl run hazelcast --image=nginx --labels="app=hazelcast,env=prod"
+
+
+

Start a replicated instance of nginx.

+
+
kubectl run nginx --image=nginx --replicas=5
+
+
+

Dry run. Print the corresponding API objects without creating them.

+
+
kubectl run nginx --image=nginx --dry-run
+
+
+

Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON.

+
+
kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
+
+
+

Start a pod of busybox and keep it in the foreground, don't restart it if it exits.

+
+
kubectl run -i -t busybox --image=busybox --restart=Never
+
+
+

Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command.

+
+
kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
+
+
+

Start the nginx container using a different command and custom arguments.

+
+
kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
+
+
+

Start the perl container to compute π to 2000 places and print it out.

+
+
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
+
+
+

Start the cron job to compute π to 2000 places and print it out every 5 minutes.

+
+
kubectl run pi --schedule="0/5 * * * ?" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
+
+

Create and run a particular image, possibly replicated.

+

Creates a deployment or job to manage the created container(s).

+

Usage

+

$ run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...]

+

Flags

+ + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
attachfalseIf true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.
cascade trueIf true, use a schema to validate the input before sending it If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
commandfalseIf true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.
dry-runfalseIf true, only print the object that would be sent, without sending it.
env[]Environment variables to set in the container
exposefalseIf true, a public, external service is created for the container(s) which are run
filenamef[]to use to replace the resource.
forcefalseOnly used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.
generatorThe name of the API generator to use, see http://kubernetes.io/docs/user-guide/kubectl-conventions/#generators for a list.
grace-period-1Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).
hostport-1The host port mapping for the container port. To demonstrate a single-machine container.
imageThe image for the container to run.
image-pull-policyThe image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server
labelslComma separated labels to apply to the pod(s). Will override previous values.
leave-stdin-openfalseIf the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.
limitsThe resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi'. Note that server side components may assign limits depending on the server configuration, such as limit ranges.
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].
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.
pod-running-timeout1m0sThe length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running
portThe port that this container exposes. If --expose is true, this is also the port used by the service that is created.
quietfalseIf true, suppress prompt messages.
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.
replicasr1Number of replicas to create for this container. Default is 1.
requestsThe resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.
restartAlwaysThe restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to 'Always' a deployment is created, if set to 'OnFailure' a job is created, if set to 'Never', a regular pod is created. For the latter two --replicas must be 1. Default 'Always', for CronJobs Never.
rmfalseIf true, delete resources created in this command for attached containers.
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.
scheduleA schedule in the Cron format the job should be run with.
service-generatorservice/v2The name of the generator to use for creating a service. Only used if --expose is true
service-overridesAn inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.
serviceaccountService account to set in the pod spec
stdinifalseKeep stdin open on the container(s) in the pod, even if nothing is attached.
timeout0sThe length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object
ttytfalseAllocated a TTY for each container in the pod.
waitfalseIf true, wait for resources to be gone before returning. This waits for finalizers.
+
+

expose

+
+

Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000.

+
+
kubectl expose rc nginx --port=80 --target-port=8000
+
+
+

Create a service for a replication controller identified by type and name specified in "nginx-controller.yaml", which serves on port 80 and connects to the containers on port 8000.

+
+
kubectl expose -f nginx-controller.yaml --port=80 --target-port=8000
+
+
+

Create a service for a pod valid-pod, which serves on port 444 with the name "frontend"

+
+
kubectl expose pod valid-pod --port=444 --name=frontend
+
+
+

Create a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx-https"

+
+
kubectl expose service nginx --port=443 --target-port=8443 --name=nginx-https
+
+
+

Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video-stream'.

+
+
kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
+
+
+

Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000.

+
+
kubectl expose rs nginx --port=80 --target-port=8000
+
+
+

Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000.

+
+
kubectl expose deployment nginx --port=80 --target-port=8000
+
+

Expose a resource as a new Kubernetes service.

+

Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the specified port. A deployment or replica set will be exposed as a service only if its selector is convertible to a selector that service supports, i.e. when the selector contains only the matchLabels component. Note that if no port is specified via --port and the exposed resource has multiple ports, all will be re-used by the new service. Also if no labels are specified, the new service will re-use the labels from the resource it exposes.

+

Possible resources include (case insensitive):

+

pod (po), service (svc), replicationcontroller (rc), deployment (deploy), replicaset (rs)

+

Usage

+

$ expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
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-port
dry-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.
filenamef[]Filename, directory, or URL to files identifying the resource to expose a service
generatorservice/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 LoadBalancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).
nameThe name for the newly created object.
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].
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 unspecified
protocolThe 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'
target-portName or number for the port on the container that the service should direct traffic to. Optional.
typeType for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName. Default is 'ClusterIP'.
@@ -3722,22 +2522,28 @@ viewing your workloads in a Kubernetes cluster.

If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. +field-selector + + +Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type. + + filename f [] -Filename, directory, or URL to files containing the resource to delete. +containing the resource to delete. force false -Immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. +Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. grace-period -1 -Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. +Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). ignore-not-found @@ -3746,12 +2552,6 @@ viewing your workloads in a Kubernetes cluster.

Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified. -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - include-uninitialized false @@ -3787,6 +2587,636 @@ viewing your workloads in a Kubernetes cluster.

0s The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object + +wait + +true +If true, wait for resources to be gone before returning. This waits for finalizers. + + + +

APP MANAGEMENT

+

This section contains commands for creating, updating, deleting, and +viewing your workloads in a Kubernetes cluster.

+
+

apply

+
+

Apply the configuration in pod.json to a pod.

+
+
kubectl apply -f ./pod.json
+
+
+

Apply the JSON passed into stdin to a pod.

+
+
cat pod.json | kubectl apply -f -
+
+
+

Note: --prune is still in Alpha # Apply the configuration in manifest.yaml that matches label app=nginx and delete all the other resources that are not in the file and match label app=nginx.

+
+
kubectl apply --prune -f manifest.yaml -l app=nginx
+
+
+

Apply the configuration in manifest.yaml and delete all the other configmaps that are not in the file.

+
+
kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap
+
+

Apply a configuration to a resource by filename or stdin. The resource name must be specified. This resource will be created if it doesn't exist yet. To use 'apply', always create the resource initially with either 'apply' or 'create --save-config'.

+

JSON and YAML formats are accepted.

+

Alpha Disclaimer: the --prune functionality is not yet complete. Do not use unless you are aware of what the current state is. See https://issues.k8s.io/34274.

+

Usage

+

$ apply -f FILENAME

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
allfalseSelect all resources in the namespace of the specified resource types.
cascadetrueIf true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]that contains the configuration to apply
forcefalseOnly used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.
grace-period-1Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
openapi-patchtrueIf true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types.
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].
overwritetrueAutomatically resolve conflicts between the modified and live configuration by using values from the modified configuration
prunefalseAutomatically delete resource objects, including the uninitialized ones, that do not appear in the configs and are created by either apply or create --save-config. Should be used with either -l or --all.
prune-whitelist[]Overwrite the default whitelist with for --prune
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.
selectorlSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
timeout0sThe length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object
validatetrueIf true, use a schema to validate the input before sending it
waitfalseIf true, wait for resources to be gone before returning. This waits for finalizers.
+
+

edit-last-applied

+
+

Edit the last-applied-configuration annotations by type/name in YAML.

+
+
kubectl apply edit-last-applied deployment/nginx
+
+
+

Edit the last-applied-configuration annotations by file in JSON.

+
+
kubectl apply edit-last-applied -f deploy.yaml -o json
+
+

Edit the latest last-applied-configuration annotations of resources from the default editor.

+

The edit-last-applied command allows you to directly edit any API resource you can retrieve via the command line tools. It will open the editor defined by your KUBE _EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. You can edit multiple objects, although changes are applied one at a time. The command accepts filenames as well as command line arguments, although the files you point to must be previously saved versions of resources.

+

The default format is YAML. To edit in JSON, specify "-o json".

+

The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.

+

In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.

+

Usage

+

$ edit-last-applied (RESOURCE/NAME | -f FILENAME)

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
filenamef[]Filename, directory, or URL to files to use to edit the resource
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
outputoyamlOutput format. One of: yaml|json.
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.
windows-line-endingsfalseDefaults to the line ending native to your platform.
+
+

set-last-applied

+
+

Set the last-applied-configuration of a resource to match the contents of a file.

+
+
kubectl apply set-last-applied -f deploy.yaml
+
+
+

Execute set-last-applied against each configuration file in a directory.

+
+
kubectl apply set-last-applied -f path/
+
+
+

Set the last-applied-configuration of a resource to match the contents of a file, will create the annotation if it does not already exist.

+
+
kubectl apply set-last-applied -f deploy.yaml --create-annotation=true
+
+

Set the latest last-applied-configuration annotations by setting it to match the contents of a file. This results in the last-applied-configuration being updated as though 'kubectl apply -f ' was run, without updating any other parts of the object.

+

Usage

+

$ set-last-applied -f FILENAME

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
create-annotationfalseWill create 'last-applied-configuration' annotations if current objects doesn't have one
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename, directory, or URL to files that contains the last-applied-configuration annotations
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].
+
+

view-last-applied

+
+

View the last-applied-configuration annotations by type/name in YAML.

+
+
kubectl apply view-last-applied deployment/nginx
+
+
+

View the last-applied-configuration annotations by file in JSON

+
+
kubectl apply view-last-applied -f deploy.yaml -o json
+
+

View the latest last-applied-configuration annotations by type/name or file.

+

The default output will be printed to stdout in YAML format. One can use -o option to change output format.

+

Usage

+

$ view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
allfalseSelect all resources in the namespace of the specified resource types
filenamef[]Filename, directory, or URL to files that contains the last-applied-configuration annotations
outputoyamlOutput format. Must be one of yaml|json
recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
selectorlSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
+
+

annotate

+
+

Update pod 'foo' with the annotation 'description' and the value 'my frontend'. # If the same annotation is set multiple times, only the last value will be applied

+
+
kubectl annotate pods foo description='my frontend'
+
+
+

Update a pod identified by type and name in "pod.json"

+
+
kubectl annotate -f pod.json description='my frontend'
+
+
+

Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value.

+
+
kubectl annotate --overwrite pods foo description='my frontend running nginx'
+
+
+

Update all pods in the namespace

+
+
kubectl annotate pods --all description='my frontend running nginx'
+
+
+

Update pod 'foo' only if the resource is unchanged from version 1.

+
+
kubectl annotate pods foo description='my frontend running nginx' --resource-version=1
+
+
+

Update pod 'foo' by removing an annotation named 'description' if it exists. # Does not require the --overwrite flag.

+
+
kubectl annotate pods foo description-
+
+

Update the annotations on one or more resources

+

All Kubernetes objects support the ability to store additional data with the object as annotations. Annotations are key/value pairs that can be larger than labels and include arbitrary string values such as structured JSON. Tools and system extensions may use annotations to store their own data.

+

Attempting to set an annotation that already exists will fail unless --overwrite is set. If --resource-version is specified and does not match the current resource version on the server the command will fail.

+

Use "kubectl api-resources" for a complete list of supported resources.

+

Usage

+

$ annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
allfalseSelect all resources, including uninitialized ones, in the namespace of the specified resource types.
dry-runfalseIf true, only print the object that would be sent, without sending it.
field-selectorSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
filenamef[]Filename, directory, or URL to files identifying the resource to update the annotation
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
localfalseIf true, annotation will NOT contact api-server but run locally.
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].
overwritefalseIf true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.
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.
resource-versionIf non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.
selectorlSelector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).
+
+

autoscale

+
+

Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used:

+
+
kubectl autoscale deployment foo --min=2 --max=10
+
+
+

Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:

+
+
kubectl autoscale rc foo --max=5 --cpu-percent=80
+
+

Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster.

+

Looks up a Deployment, ReplicaSet, or ReplicationController by name and creates an autoscaler that uses the given resource as a reference. An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.

+

Usage

+

$ autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
cpu-percent-1The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, a default autoscaling policy will be used.
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename, directory, or URL to files identifying the resource to autoscale.
generatorhorizontalpodautoscaler/v1The name of the API generator to use. Currently there is only 1 generator.
max-1The upper limit for the number of pods that can be set by the autoscaler. Required.
min-1The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.
nameThe name for the newly created object. If not specified, the name of the input resource will be used.
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].
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.
+
+

convert

+
+

Convert 'pod.yaml' to latest version and print to stdout.

+
+
kubectl convert -f pod.yaml
+
+
+

Convert the live state of the resource specified by 'pod.yaml' to the latest version # and print to stdout in JSON format.

+
+
kubectl convert -f pod.yaml --local -o json
+
+
+

Convert all files under current directory to latest version and create them all.

+
+
kubectl convert -f . | kubectl create -f -
+
+

Convert config files between different API versions. Both YAML and JSON formats are accepted.

+

The command takes filename, directory, or URL as input, and convert it into format of version specified by --output-version flag. If target version is not specified or not supported, convert to latest version.

+

The default output will be printed to stdout in YAML format. One can use -o option to change to output destination.

+

Usage

+

$ convert -f FILENAME

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
filenamef[]Filename, directory, or URL to files to need to get converted.
localtrueIf true, convert will NOT try to contact api-server but run locally.
outputoyamlOutput 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-versionOutput the formatted object with the given group version (for ex: 'extensions/v1beta1').)
recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
validatetrueIf true, use a schema to validate the input before sending it

@@ -3837,12 +3267,6 @@ viewing your workloads in a Kubernetes cluster.

Filename, directory, or URL to files to use to edit the resource -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - include-uninitialized false @@ -3851,8 +3275,8 @@ viewing your workloads in a Kubernetes cluster.

output o -yaml -Output format. One of: yaml|json. + +Output 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-patch @@ -3893,262 +3317,6 @@ viewing your workloads in a Kubernetes cluster.


-

get

-
-

List all pods in ps output format.

-
-
kubectl get pods
-
-
-

List all pods in ps output format with more information (such as node name).

-
-
kubectl get pods -o wide
-
-
-

List a single replication controller with specified NAME in ps output format.

-
-
kubectl get replicationcontroller web
-
-
-

List a single pod in JSON output format.

-
-
kubectl get -o json pod web-pod-13je7
-
-
-

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

-
-
kubectl get -f pod.yaml -o json
-
-
-

Return only the phase value of the specified pod.

-
-
kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}}
-
-
-

List all replication controllers and services together in ps output format.

-
-
kubectl get rc,services
-
-
-

List one or more resources by their type and names.

-
-
kubectl get rc/web service/frontend pods/web-pod-13je7
-
-
-

List all resources with different types.

-
-
kubectl get all
-
-

Display one or many resources

-

Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current namespace unless you pass --all-namespaces.

-

Uninitialized objects are not shown unless --include-uninitialized is passed.

-

By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.

-

Valid resource types include:

-
    -
  • all
  • -
  • certificatesigningrequests (aka 'csr')
  • -
  • clusterrolebindings
  • -
  • clusterroles
  • -
  • componentstatuses (aka 'cs')
  • -
  • configmaps (aka 'cm')
  • -
  • controllerrevisions
  • -
  • cronjobs
  • -
  • customresourcedefinition (aka 'crd')
  • -
  • daemonsets (aka 'ds')
  • -
  • deployments (aka 'deploy')
  • -
  • endpoints (aka 'ep')
  • -
  • events (aka 'ev')
  • -
  • horizontalpodautoscalers (aka 'hpa')
  • -
  • ingresses (aka 'ing')
  • -
  • jobs
  • -
  • limitranges (aka 'limits')
  • -
  • namespaces (aka 'ns')
  • -
  • networkpolicies (aka 'netpol')
  • -
  • nodes (aka 'no')
  • -
  • persistentvolumeclaims (aka 'pvc')
  • -
  • persistentvolumes (aka 'pv')
  • -
  • poddisruptionbudgets (aka 'pdb')
  • -
  • podpreset
  • -
  • pods (aka 'po')
  • -
  • podsecuritypolicies (aka 'psp')
  • -
  • podtemplates
  • -
  • replicasets (aka 'rs')
  • -
  • replicationcontrollers (aka 'rc')
  • -
  • resourcequotas (aka 'quota')
  • -
  • rolebindings
  • -
  • roles
  • -
  • secrets
  • -
  • serviceaccounts (aka 'sa')
  • -
  • services (aka 'svc')
  • -
  • statefulsets (aka 'sts')
  • -
  • storageclasses (aka 'sc')
  • -
-

Usage

-

$ get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE [NAME | -l label] | TYPE/NAME ...) [flags]

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
all-namespacesfalseIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
allow-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.
chunk-size500Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
experimental-server-printfalseIf true, have the server return the appropriate table output. Supports extension APIs and CRD. Experimental.
exportfalseIf true, use 'export' for the resources. Exported resources are stripped of cluster-specific information.
field-selectorSelector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
filenamef[]Filename, directory, or URL to files identifying the resource to get from a server.
ignore-not-foundfalseIf the requested object does not exist the command will return exit code 0.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
label-columnsL[]Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
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').
rawRaw URI to request from the server. Uses the transport specified by the kubeconfig file.
recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
selectorlSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
show-kindfalseIf present, list the resource type for the requested object(s).
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.
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].
use-openapi-print-columnstrueIf true, use x-kubernetes-print-column metadata (if present) from the OpenAPI schema for displaying a resource.
watchwfalseAfter listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
watch-onlyfalseWatch for changes to the requested object(s), without listing/getting first.
-

label

Update pod 'foo' with the label 'unhealthy' and the value 'true'.

@@ -4207,30 +3375,24 @@ viewing your workloads in a Kubernetes cluster.

Select all resources, including uninitialized ones, in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - dry-run false If true, only print the object that would be sent, without sending it. +field-selector + + +Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type. + + filename f [] Filename, directory, or URL to files identifying the resource to update the labels -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - include-uninitialized false @@ -4249,24 +3411,12 @@ viewing your workloads in a Kubernetes cluster.

If true, label will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - overwrite false @@ -4296,30 +3446,6 @@ viewing your workloads in a Kubernetes cluster.

Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -4366,10 +3492,10 @@ viewing your workloads in a Kubernetes cluster.

-allow-missing-template-keys +dry-run -true -If 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. +false +If true, only print the object that would be sent, without sending it. filename @@ -4378,36 +3504,18 @@ viewing your workloads in a Kubernetes cluster.

Filename, directory, or URL to files identifying the resource to update -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - local false If true, patch will operate on the content of the file, not the server-side resource. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - patch p @@ -4426,30 +3534,6 @@ viewing your workloads in a Kubernetes cluster.

Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. - - type strategic @@ -4499,44 +3583,32 @@ viewing your workloads in a Kubernetes cluster.

cascade -false -Only relevant during a force replace. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). +true +If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. filename f [] -Filename, directory, or URL to files to use to replace the resource. +to use to replace the resource. force false -Delete and re-create the specified resource +Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. grace-period -1 -Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. - - -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] +Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). output o -Output mode. Use "-o name" for shorter output (resource/name). - - -record - -false -Record 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. +Output 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]. recursive @@ -4554,7 +3626,7 @@ viewing your workloads in a Kubernetes cluster.

timeout 0s -Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h). +The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object validate @@ -4562,170 +3634,11 @@ viewing your workloads in a Kubernetes cluster.

true If true, use a schema to validate the input before sending it - - -
-

rolling-update

-
-

Update pods of frontend-v1 using new replication controller data in frontend-v2.json.

-
-
kubectl rolling-update frontend-v1 -f frontend-v2.json
-
-
-

Update pods of frontend-v1 using JSON data passed into stdin.

-
-
cat frontend-v2.json | kubectl rolling-update frontend-v1 -f -
-
-
-

Update the pods of frontend-v1 to frontend-v2 by just changing the image, and switching the # name of the replication controller.

-
-
kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2
-
-
-

Update the pods of frontend by just changing the image, and keeping the old name.

-
-
kubectl rolling-update frontend --image=image:v2
-
-
-

Abort and reverse an existing rollout in progress (from frontend-v1 to frontend-v2).

-
-
kubectl rolling-update frontend-v1 frontend-v2 --rollback
-
-

Perform a rolling update of the given ReplicationController.

-

Replaces the specified replication controller with a new replication controller by updating one pod at a time to use the new PodTemplate. The new-controller.json must specify the same namespace as the existing replication controller and overwrite at least one (common) label in its replicaSelector.

-

! http://kubernetes.io/images/docs/kubectl_rollingupdate.svg

-

Usage

-

$ rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
NameShorthandDefaultUsage
allow-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.
containerContainer name which will have its image upgraded. Only relevant when --image is specified, ignored otherwise. Required when using --image on a multi-container pod
deployment-label-keydeploymentThe key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise
dry-runwait falseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename or URL to file to use to create the new replication controller.
imageImage to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
image-pull-policyExplicit policy for when to pull container images. Required when --image is same as existing image, ignored otherwise.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
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').
poll-interval3sTime delay between polling for replication controller status after the update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
rollbackfalseIf true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
timeout5m0sMax time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
update-period1m0sTime to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
validatetrueIf true, use a schema to validate the input before sending it If true, wait for resources to be gone before returning. This waits for finalizers.
@@ -5035,16 +3948,10 @@ viewing your workloads in a Kubernetes cluster.

Filename, directory, or URL to files identifying the resource to set a new size -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - output o -Output mode. Use "-o name" for shorter output (resource/name). +Output 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]. record @@ -5061,7 +3968,7 @@ viewing your workloads in a Kubernetes cluster.

replicas --1 +0 The new desired number of replicas. Required. @@ -5128,6 +4035,11 @@ viewing your workloads in a Kubernetes cluster.

kubectl set env --from=configmap/myconfigmap --prefix=MYSQL_ deployment/myapp
 
+

Import specific keys from a config map

+
+
kubectl set env --keys=my-example-key --from=configmap/myconfigmap deployment/myapp
+
+

Remove the environment variable ENV from container 'c1' in all deployment configs

kubectl set env deployments --all --containers="c1" ENV-
@@ -5167,12 +4079,6 @@ viewing your workloads in a Kubernetes cluster.

If true, select all resources in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - containers c * @@ -5203,6 +4109,12 @@ viewing your workloads in a Kubernetes cluster.

The name of a resource from which to inject environment variables +keys + +[] +Comma-separated list of keys to import from specified resource + + list false @@ -5215,24 +4127,12 @@ viewing your workloads in a Kubernetes cluster.

If true, set env will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - overwrite true @@ -5262,30 +4162,6 @@ viewing your workloads in a Kubernetes cluster.

Selector (label query) to filter on - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -5333,12 +4209,6 @@ viewing your workloads in a Kubernetes cluster.

Select all resources, including uninitialized ones, in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - dry-run false @@ -5363,24 +4233,12 @@ viewing your workloads in a Kubernetes cluster.

If true, set image will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - record false @@ -5398,30 +4256,6 @@ viewing your workloads in a Kubernetes cluster.

Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -5448,7 +4282,7 @@ viewing your workloads in a Kubernetes cluster.

Specify compute resource requirements (cpu, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits.

for each compute resource, if a limit is specified and a request is omitted, the request will default to the limit.

-

Possible resources include (case insensitive): replicationcontroller, deployment, daemonset, job, replicaset.

+

Possible resources include (case insensitive): Use "kubectl api-resources" for a complete list of supported resources..

Usage

$ resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]

Flags

@@ -5469,12 +4303,6 @@ viewing your workloads in a Kubernetes cluster.

Select all resources, including uninitialized ones, in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - containers c * @@ -5511,24 +4339,12 @@ viewing your workloads in a Kubernetes cluster.

If true, set resources will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - record false @@ -5552,30 +4368,6 @@ viewing your workloads in a Kubernetes cluster.

Selector (label query) to filter on, not including uninitialized ones,supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -5605,13 +4397,7 @@ viewing your workloads in a Kubernetes cluster.

all false -Select all resources, including uninitialized ones, in the namespace of the specified resource types - - -allow-missing-template-keys - -true -If 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. +Select all resources in the namespace of the specified resource types dry-run @@ -5623,7 +4409,7 @@ viewing your workloads in a Kubernetes cluster.

filename f [] -Filename, directory, or URL to files the resource to update the selectors +identifying the resource. include-uninitialized @@ -5635,13 +4421,7 @@ viewing your workloads in a Kubernetes cluster.

local false -If true, set selector will NOT contact api-server but run locally. - - -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). +If true, annotation will NOT contact api-server but run locally. output @@ -5650,12 +4430,6 @@ viewing your workloads in a Kubernetes cluster.

Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - record false @@ -5664,7 +4438,7 @@ viewing your workloads in a Kubernetes cluster.

recursive R -false +true Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. @@ -5673,30 +4447,6 @@ viewing your workloads in a Kubernetes cluster.

If non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -5734,12 +4484,6 @@ viewing your workloads in a Kubernetes cluster.

Select all resources, including uninitialized ones, in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - dry-run false @@ -5764,24 +4508,12 @@ viewing your workloads in a Kubernetes cluster.

If true, set serviceaccount will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - record false @@ -5793,30 +4525,6 @@ viewing your workloads in a Kubernetes cluster.

false Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -5857,12 +4565,6 @@ viewing your workloads in a Kubernetes cluster.

Select all resources, including uninitialized ones, in the namespace of the specified resource types -allow-missing-template-keys - -true -If 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. - - dry-run false @@ -5893,24 +4595,12 @@ viewing your workloads in a Kubernetes cluster.

If true, set subject will NOT contact api-server but run locally. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - recursive R false @@ -5928,60 +4618,12 @@ viewing your workloads in a Kubernetes cluster.

[] Service accounts to bind to the role - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. - -

DECLARATIVE APP MANAGEMENT


-

apply

-
-

Apply the configuration in pod.json to a pod.

-
-
kubectl apply -f ./pod.json
-
-
-

Apply the JSON passed into stdin to a pod.

-
-
cat pod.json | kubectl apply -f -
-
-
-

Note: --prune is still in Alpha # Apply the configuration in manifest.yaml that matches label app=nginx and delete all the other resources that are not in the file and match label app=nginx.

-
-
kubectl apply --prune -f manifest.yaml -l app=nginx
-
-
-

Apply the configuration in manifest.yaml and delete all the other configmaps that are not in the file.

-
-
kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap
-
-

Apply a configuration to a resource by filename or stdin. The resource name must be specified. This resource will be created if it doesn't exist yet. To use 'apply', always create the resource initially with either 'apply' or 'create --save-config'.

-

JSON and YAML formats are accepted.

-

Alpha Disclaimer: the --prune functionality is not yet complete. Do not use unless you are aware of what the current state is. See https://issues.k8s.io/34274.

+

wait

Usage

-

$ apply -f FILENAME

+

$ wait resource.group/name [--for=delete|--for condition=available]

Flags

@@ -5994,70 +4636,22 @@ viewing your workloads in a Kubernetes cluster.

- + - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -6066,39 +4660,9 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -6108,272 +4672,10 @@ viewing your workloads in a Kubernetes cluster.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
allall-namespaces falseSelect all resources in the namespace of the specified resource types.
allow-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.
cascadetrueOnly relevant during a prune or a force apply. If true, cascade the deletion of the resources managed by pruned or deleted resources (e.g. Pods created by a ReplicationController).
dry-runfalseIf true, only print the object that would be sent, without sending it. If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
filename f []Filename, directory, or URL to files that contains the configuration to apply identifying the resource.
forcefor falseDelete and re-create the specified resource, when PATCH encounters conflict and has retried for 5 times.
grace-period -1Only relevant during a prune or a force apply. Period of time in seconds given to pruned or deleted resources to terminate gracefully. Ignored if negative.
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
openapi-patchtrueIf true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types. The condition to wait on: [delete|condition=condition-name].
output Output 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').
overwritetrueAutomatically resolve conflicts between the modified and live configuration by using values from the modified configuration
prunefalseAutomatically delete resource objects, including the uninitialized ones, that do not appear in the configs and are created by either apply or create --save-config. Should be used with either -l or --all.
prune-whitelist[]Overwrite the default whitelist with for --prune
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.
recursive Rfalsetrue Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
timeout 0sOnly relevant during a force apply. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
validatetrueIf true, use a schema to validate the input before sending it
-
-

edit-last-applied

-
-

Edit the last-applied-configuration annotations by type/name in YAML.

-
-
kubectl apply edit-last-applied deployment/nginx
-
-
-

Edit the last-applied-configuration annotations by file in JSON.

-
-
kubectl apply edit-last-applied -f deploy.yaml -o json
-
-

Edit the latest last-applied-configuration annotations of resources from the default editor.

-

The edit-last-applied command allows you to directly edit any API resource you can retrieve via the command line tools. It will open the editor defined by your KUBE _EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. You can edit multiple objects, although changes are applied one at a time. The command accepts filenames as well as command line arguments, although the files you point to must be previously saved versions of resources.

-

The default format is YAML. To edit in JSON, specify "-o json".

-

The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.

-

In the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version.

-

Usage

-

$ edit-last-applied (RESOURCE/NAME | -f FILENAME)

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
filenamef[]Filename, directory, or URL to files to use to edit the resource
include-uninitializedfalseIf true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.
outputoyamlOutput format. One of: yaml|json.
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.
windows-line-endingsfalseDefaults to the line ending native to your platform.
-
-

set-last-applied

-
-

Set the last-applied-configuration of a resource to match the contents of a file.

-
-
kubectl apply set-last-applied -f deploy.yaml
-
-
-

Execute set-last-applied against each configuration file in a directory.

-
-
kubectl apply set-last-applied -f path/
-
-
-

Set the last-applied-configuration of a resource to match the contents of a file, will create the annotation if it does not already exist.

-
-
kubectl apply set-last-applied -f deploy.yaml --create-annotation=true
-
-

Set the latest last-applied-configuration annotations by setting it to match the contents of a file. This results in the last-applied-configuration being updated as though 'kubectl apply -f ' was run, without updating any other parts of the object.

-

Usage

-

$ set-last-applied -f FILENAME

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
allow-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.
create-annotationfalseWill create 'last-applied-configuration' annotations if current objects doesn't have one
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename, directory, or URL to files that contains the last-applied-configuration annotations
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').
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.
show-allatrueWhen printing, show all resources (default show all pods including terminated one.)
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.
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].
-
-

view-last-applied

-
-

View the last-applied-configuration annotations by type/name in YAML.

-
-
kubectl apply view-last-applied deployment/nginx
-
-
-

View the last-applied-configuration annotations by file in JSON

-
-
kubectl apply view-last-applied -f deploy.yaml -o json
-
-

View the latest last-applied-configuration annotations by type/name or file.

-

The default output will be printed to stdout in YAML format. One can use -o option to change output format.

-

Usage

-

$ view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)

-

Flags

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
NameShorthandDefaultUsage
allfalseSelect all resources in the namespace of the specified resource types
filenamef[]Filename, directory, or URL to files that contains the last-applied-configuration annotations
outputoOutput format. Must be one of yaml|json
recursiveRfalseProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
selectorlSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) 30sThe length of time to wait before giving up. Zero means check once and don't wait, negative means wait for a week.
@@ -6542,10 +4844,10 @@ applications.

-allow-missing-template-keys +dry-run -true -If 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. +false +If true, display results but do not submit changes filename @@ -6554,53 +4856,17 @@ applications.

Filename, directory, or URL to files identifying the resource to reconcile. -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - recursive R false Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. - -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. -
@@ -6683,46 +4949,7 @@ applications.

Print a detailed description of the selected resources, including related resources such as events or controllers. You may select a single object by name, all objects of that type, provide a name prefix, or label selector. For example:

$ kubectl describe TYPE NAME_PREFIX

will first check for an exact match on TYPE and NAME PREFIX. If no such resource exists, it will output details for every resource that has a name prefixed with NAME PREFIX.

-

Valid resource types include:

-
    -
  • all
  • -
  • certificatesigningrequests (aka 'csr')
  • -
  • clusterrolebindings
  • -
  • clusterroles
  • -
  • componentstatuses (aka 'cs')
  • -
  • configmaps (aka 'cm')
  • -
  • controllerrevisions
  • -
  • cronjobs
  • -
  • customresourcedefinition (aka 'crd')
  • -
  • daemonsets (aka 'ds')
  • -
  • deployments (aka 'deploy')
  • -
  • endpoints (aka 'ep')
  • -
  • events (aka 'ev')
  • -
  • horizontalpodautoscalers (aka 'hpa')
  • -
  • ingresses (aka 'ing')
  • -
  • jobs
  • -
  • limitranges (aka 'limits')
  • -
  • namespaces (aka 'ns')
  • -
  • networkpolicies (aka 'netpol')
  • -
  • nodes (aka 'no')
  • -
  • persistentvolumeclaims (aka 'pvc')
  • -
  • persistentvolumes (aka 'pv')
  • -
  • poddisruptionbudgets (aka 'pdb')
  • -
  • podpreset
  • -
  • pods (aka 'po')
  • -
  • podsecuritypolicies (aka 'psp')
  • -
  • podtemplates
  • -
  • replicasets (aka 'rs')
  • -
  • replicationcontrollers (aka 'rc')
  • -
  • resourcequotas (aka 'quota')
  • -
  • rolebindings
  • -
  • roles
  • -
  • secrets
  • -
  • serviceaccounts (aka 'sa')
  • -
  • services (aka 'svc')
  • -
  • statefulsets (aka 'sts')
  • -
  • storageclasses (aka 'sc')
  • -
+

Use "kubectl api-resources" for a complete list of supported resources.

Usage

$ describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)

Flags

@@ -6749,12 +4976,6 @@ applications.

Filename, directory, or URL to files containing the resource to describe -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - include-uninitialized false @@ -6850,9 +5071,14 @@ applications.

kubectl logs nginx
 
-

Return snapshot logs for the pods defined by label app=nginx

+

Return snapshot logs from pod nginx with multi containers

-
kubectl logs -lapp=nginx
+
kubectl logs nginx --all-containers=true
+
+
+

Return snapshot logs from all containers in pods defined by label app=nginx

+
+
kubectl logs -lapp=nginx --all-containers=true
 

Return snapshot of previous terminated ruby container logs from pod web-1

@@ -6899,6 +5125,12 @@ applications.

+all-containers + +false +Get all containers's logs in the pod(s). + + container c @@ -6911,12 +5143,6 @@ applications.

Specify if the logs should be streamed. -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - interactive false @@ -7321,10 +5547,16 @@ applications.

Filename, directory, or URL to files identifying the resource to update +force + +false +Update the CSR even if it is already approved. + + output o -Output mode. Use "-o name" for shorter output (resource/name). +Output 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]. recursive @@ -7358,10 +5590,16 @@ applications.

Filename, directory, or URL to files identifying the resource to update +force + +false +Update the CSR even if it is already denied. + + output o -Output mode. Use "-o name" for shorter output (resource/name). +Output 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]. recursive @@ -7381,25 +5619,6 @@ applications.

Display addresses of the master and services with label kubernetes.io/cluster-service=true To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Usage

$ cluster-info

-

Flags

- - - - - - - - - - - - - - - - - -
NameShorthandDefaultUsage
include-extended-apistrueIf true, include definitions of new APIs via calls to the API server. [default true]

dump

@@ -7629,36 +5848,12 @@ applications.

Select all nodes in the cluster -allow-missing-template-keys - -true -If 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. - - -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - -no-headers - -false -When using the default or custom-column output format, don't print headers (default print headers). - - output o Output 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-version - - -DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). - - overwrite false @@ -7671,30 +5866,6 @@ applications.

Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) -show-all -a -true -When printing, show all resources (default show all pods including terminated one.) - - -show-labels - -false -When printing, show all labels as the last column (default hide labels column) - - -sort-by - - -If 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. - - -template - - -Template 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]. - - validate true @@ -7792,6 +5963,85 @@ applications.


+

api-resources

+
+

Print the supported API Resources

+
+
kubectl api-resources
+
+
+

Print the supported API Resources with more information

+
+
kubectl api-resources -o wide
+
+
+

Print the supported namespaced resources

+
+
kubectl api-resources --namespaced=true
+
+
+

Print the supported non-namespaced resources

+
+
kubectl api-resources --namespaced=false
+
+
+

Print the supported API Resources with specific APIGroup

+
+
kubectl api-resources --api-group=extensions
+
+

Print the supported API resources on the server

+

Usage

+

$ api-resources

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
api-groupLimit to resources in the specified API group.
cachedfalseUse the cached list of resources if available.
namespacedtrueIf false, non-namespaced resources will be returned, otherwise returning namespaced resources by default.
no-headersfalseWhen using the default or custom-column output format, don't print headers (default print headers).
outputoOutput format. One of: wide|name.
verbs[]Limit to resources that support the specified verbs.
+

completion

Installing bash completion on macOS using homebrew ## If running Bash 3.2 included with macOS

@@ -7919,12 +6169,6 @@ source $HOME/.bash_profile -allow-missing-template-keys - -true -If 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. - - no-headers false @@ -7934,7 +6178,7 @@ source $HOME/.bash_profile output o -Output 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 format. One of: name @@ -8100,6 +6344,18 @@ source $HOME/.bash_profile false Embed client cert/key for the user entry in kubeconfig + +password + + +password for the user entry in kubeconfig + + +username + + +username for the user entry in kubeconfig +
@@ -8131,11 +6387,16 @@ source $HOME/.bash_profile

view

-

Show Merged kubeconfig settings.

+

Show merged kubeconfig settings.

kubectl config view
 
+

Show merged kubeconfig settings and raw certificate data.

+
+
kubectl config view --raw
+
+

Get the password for the e2e user

kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
@@ -8180,22 +6441,10 @@ source $HOME/.bash_profile
 Remove all information not used by current-context from the output 
 
 
-no-headers
-
-false
-When using the default or custom-column output format, don't print headers (default print headers). 
-
-
 output
 o
-
-Output 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-version
-
-
-DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob'). 
+yaml
+Output format. One of: json|yaml|name|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]. 
 
 
 raw
@@ -8204,24 +6453,6 @@ source $HOME/.bash_profile
 Display raw byte data 
 
 
-show-all
-a
-true
-When printing, show all resources (default show all pods including terminated one.) 
-
-
-show-labels
-
-false
-When printing, show all labels as the last column (default hide labels column) 
-
-
-sort-by
-
-
-If 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. 
-
-
 template
 
 
@@ -8245,46 +6476,7 @@ source $HOME/.bash_profile
 

This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:

.[.]

Add the --recursive flag to display all of the fields at once without descriptions. Information about each field is retrieved from the server in OpenAPI format.

-

Valid resource types include:

-
    -
  • all
  • -
  • certificatesigningrequests (aka 'csr')
  • -
  • clusterrolebindings
  • -
  • clusterroles
  • -
  • componentstatuses (aka 'cs')
  • -
  • configmaps (aka 'cm')
  • -
  • controllerrevisions
  • -
  • cronjobs
  • -
  • customresourcedefinition (aka 'crd')
  • -
  • daemonsets (aka 'ds')
  • -
  • deployments (aka 'deploy')
  • -
  • endpoints (aka 'ep')
  • -
  • events (aka 'ev')
  • -
  • horizontalpodautoscalers (aka 'hpa')
  • -
  • ingresses (aka 'ing')
  • -
  • jobs
  • -
  • limitranges (aka 'limits')
  • -
  • namespaces (aka 'ns')
  • -
  • networkpolicies (aka 'netpol')
  • -
  • nodes (aka 'no')
  • -
  • persistentvolumeclaims (aka 'pvc')
  • -
  • persistentvolumes (aka 'pv')
  • -
  • poddisruptionbudgets (aka 'pdb')
  • -
  • podpreset
  • -
  • pods (aka 'po')
  • -
  • podsecuritypolicies (aka 'psp')
  • -
  • podtemplates
  • -
  • replicasets (aka 'rs')
  • -
  • replicationcontrollers (aka 'rc')
  • -
  • resourcequotas (aka 'quota')
  • -
  • rolebindings
  • -
  • roles
  • -
  • secrets
  • -
  • serviceaccounts (aka 'sa')
  • -
  • services (aka 'svc')
  • -
  • statefulsets (aka 'sts')
  • -
  • storageclasses (aka 'sc')
  • -
+

Use "kubectl api-resources" for a complete list of supported resources.

Usage

$ explain RESOURCE

Flags

@@ -8305,12 +6497,6 @@ source $HOME/.bash_profile Get different explanations for particular API version -include-extended-apis - -true -If true, include definitions of new APIs via calls to the API server. [default true] - - recursive false @@ -8329,6 +6515,12 @@ source $HOME/.bash_profile

Usage

$ options


+

plugin

+

Runs a command-line plugin.

+

Plugins are subcommands that are not part of the major command-line distribution and can even be provided by third-parties. Please refer to the documentation and examples for more information about how to install and write your own plugins.

+

Usage

+

$ plugin NAME

+

version

Print the client and server versions for the current context

@@ -8369,13 +6561,419 @@ source $HOME/.bash_profile -
-

plugin

-

Runs a command-line plugin.

-

Plugins are subcommands that are not part of the major command-line distribution and can even be provided by third-parties. Please refer to the documentation and examples for more information about how to install and write your own plugins.

-

Usage

-

$ plugin NAME

DEPRECATED COMMANDS

+
+

rolling-update

+
+

Update pods of frontend-v1 using new replication controller data in frontend-v2.json.

+
+
kubectl rolling-update frontend-v1 -f frontend-v2.json
+
+
+

Update pods of frontend-v1 using JSON data passed into stdin.

+
+
cat frontend-v2.json | kubectl rolling-update frontend-v1 -f -
+
+
+

Update the pods of frontend-v1 to frontend-v2 by just changing the image, and switching the # name of the replication controller.

+
+
kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2
+
+
+

Update the pods of frontend by just changing the image, and keeping the old name.

+
+
kubectl rolling-update frontend --image=image:v2
+
+
+

Abort and reverse an existing rollout in progress (from frontend-v1 to frontend-v2).

+
+
kubectl rolling-update frontend-v1 frontend-v2 --rollback
+
+

Perform a rolling update of the given ReplicationController.

+

Replaces the specified replication controller with a new replication controller by updating one pod at a time to use the new PodTemplate. The new-controller.json must specify the same namespace as the existing replication controller and overwrite at least one (common) label in its replicaSelector.

+

! http://kubernetes.io/images/docs/kubectl_rollingupdate.svg

+

Usage

+

$ rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
containerContainer name which will have its image upgraded. Only relevant when --image is specified, ignored otherwise. Required when using --image on a multi-container pod
deployment-label-keydeploymentThe key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise
dry-runfalseIf true, only print the object that would be sent, without sending it.
filenamef[]Filename or URL to file to use to create the new replication controller.
imageImage to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
image-pull-policyExplicit policy for when to pull container images. Required when --image is same as existing image, ignored otherwise.
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].
poll-interval3sTime delay between polling for replication controller status after the update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
rollbackfalseIf true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout
timeout5m0sMax time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
update-period1m0sTime to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
validatetrueIf true, use a schema to validate the input before sending it
+
+

run-container

+
+

Start a single instance of nginx.

+
+
kubectl run nginx --image=nginx
+
+
+

Start a single instance of hazelcast and let the container expose port 5701 .

+
+
kubectl run hazelcast --image=hazelcast --port=5701
+
+
+

Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.

+
+
kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
+
+
+

Start a single instance of hazelcast and set labels "app=hazelcast" and "env=prod" in the container.

+
+
kubectl run hazelcast --image=nginx --labels="app=hazelcast,env=prod"
+
+
+

Start a replicated instance of nginx.

+
+
kubectl run nginx --image=nginx --replicas=5
+
+
+

Dry run. Print the corresponding API objects without creating them.

+
+
kubectl run nginx --image=nginx --dry-run
+
+
+

Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON.

+
+
kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
+
+
+

Start a pod of busybox and keep it in the foreground, don't restart it if it exits.

+
+
kubectl run -i -t busybox --image=busybox --restart=Never
+
+
+

Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command.

+
+
kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
+
+
+

Start the nginx container using a different command and custom arguments.

+
+
kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
+
+
+

Start the perl container to compute π to 2000 places and print it out.

+
+
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
+
+
+

Start the cron job to compute π to 2000 places and print it out every 5 minutes.

+
+
kubectl run pi --schedule="0/5 * * * ?" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
+
+

Create and run a particular image, possibly replicated.

+

Creates a deployment or job to manage the created container(s).

+

Usage

+

$ run-container

+

Flags

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameShorthandDefaultUsage
attachfalseIf true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.
cascadetrueIf true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
commandfalseIf true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.
dry-runfalseIf true, only print the object that would be sent, without sending it.
env[]Environment variables to set in the container
exposefalseIf true, a public, external service is created for the container(s) which are run
filenamef[]to use to replace the resource.
forcefalseOnly used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.
generatorThe name of the API generator to use, see http://kubernetes.io/docs/user-guide/kubectl-conventions/#generators for a list.
grace-period-1Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).
hostport-1The host port mapping for the container port. To demonstrate a single-machine container.
imageThe image for the container to run.
image-pull-policyThe image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server
labelslComma separated labels to apply to the pod(s). Will override previous values.
leave-stdin-openfalseIf the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.
limitsThe resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi'. Note that server side components may assign limits depending on the server configuration, such as limit ranges.
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].
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.
pod-running-timeout1m0sThe length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running
portThe port that this container exposes. If --expose is true, this is also the port used by the service that is created.
quietfalseIf true, suppress prompt messages.
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.
replicasr1Number of replicas to create for this container. Default is 1.
requestsThe resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.
restartAlwaysThe restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to 'Always' a deployment is created, if set to 'OnFailure' a job is created, if set to 'Never', a regular pod is created. For the latter two --replicas must be 1. Default 'Always', for CronJobs Never.
rmfalseIf true, delete resources created in this command for attached containers.
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.
scheduleA schedule in the Cron format the job should be run with.
service-generatorservice/v2The name of the generator to use for creating a service. Only used if --expose is true
service-overridesAn inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.
serviceaccountService account to set in the pod spec
stdinifalseKeep stdin open on the container(s) in the pod, even if nothing is attached.
timeout0sThe length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object
ttytfalseAllocated a TTY for each container in the pod.
waitfalseIf true, wait for resources to be gone before returning. This waits for finalizers.
diff --git a/static/docs/reference/generated/kubectl/navData.js b/static/docs/reference/generated/kubectl/navData.js index 213410f510..4df43b4b82 100644 --- a/static/docs/reference/generated/kubectl/navData.js +++ b/static/docs/reference/generated/kubectl/navData.js @@ -1 +1 @@ -(function(){navData = {"toc":[{"section":"-strong-deprecated-commands-strong-","subsections":[]},{"section":"plugin","subsections":[]},{"section":"version","subsections":[]},{"section":"options","subsections":[]},{"section":"explain","subsections":[]},{"section":"config","subsections":[{"section":"-em-view-em-"},{"section":"-em-use-context-em-"},{"section":"-em-unset-em-"},{"section":"-em-set-credentials-em-"},{"section":"-em-set-context-em-"},{"section":"-em-set-cluster-em-"},{"section":"-em-set-em-"},{"section":"-em-rename-context-em-"},{"section":"-em-get-contexts-em-"},{"section":"-em-get-clusters-em-"},{"section":"-em-delete-context-em-"},{"section":"-em-delete-cluster-em-"},{"section":"-em-current-context-em-"}]},{"section":"completion","subsections":[]},{"section":"alpha","subsections":[{"section":"-em-diff-em-"}]},{"section":"-strong-kubectl-settings-and-usage-strong-","subsections":[]},{"section":"uncordon","subsections":[]},{"section":"taint","subsections":[]},{"section":"drain","subsections":[]},{"section":"cordon","subsections":[]},{"section":"cluster-info","subsections":[{"section":"-em-dump-em-"}]},{"section":"certificate","subsections":[{"section":"-em-deny-em-"},{"section":"-em-approve-em-"}]},{"section":"api-versions","subsections":[]},{"section":"-strong-cluster-management-strong-","subsections":[]},{"section":"top","subsections":[{"section":"-em-pod-em-"},{"section":"-em-node-em-"}]},{"section":"proxy","subsections":[]},{"section":"port-forward","subsections":[]},{"section":"logs","subsections":[]},{"section":"exec","subsections":[]},{"section":"describe","subsections":[]},{"section":"cp","subsections":[]},{"section":"auth","subsections":[{"section":"-em-reconcile-em-"},{"section":"-em-can-i-em-"}]},{"section":"attach","subsections":[]},{"section":"-strong-working-with-apps-strong-","subsections":[]},{"section":"apply","subsections":[{"section":"-em-view-last-applied-em-"},{"section":"-em-set-last-applied-em-"},{"section":"-em-edit-last-applied-em-"}]},{"section":"-strong-declarative-app-management-strong-","subsections":[]},{"section":"set","subsections":[{"section":"-em-subject-em-"},{"section":"-em-serviceaccount-em--1"},{"section":"-em-selector-em-"},{"section":"-em-resources-em-"},{"section":"-em-image-em-"},{"section":"-em-env-em-"}]},{"section":"scale","subsections":[]},{"section":"rollout","subsections":[{"section":"-em-undo-em-"},{"section":"-em-status-em-"},{"section":"-em-resume-em-"},{"section":"-em-pause-em-"},{"section":"-em-history-em-"}]},{"section":"rolling-update","subsections":[]},{"section":"replace","subsections":[]},{"section":"patch","subsections":[]},{"section":"label","subsections":[]},{"section":"get","subsections":[]},{"section":"edit","subsections":[]},{"section":"delete","subsections":[]},{"section":"create","subsections":[{"section":"-em-serviceaccount-em-"},{"section":"-em-service-nodeport-em-"},{"section":"-em-service-loadbalancer-em-"},{"section":"-em-service-externalname-em-"},{"section":"-em-service-clusterip-em-"},{"section":"-em-service-em-"},{"section":"-em-secret-tls-em-"},{"section":"-em-secret-generic-em-"},{"section":"-em-secret-docker-registry-em-"},{"section":"-em-secret-em-"},{"section":"-em-rolebinding-em-"},{"section":"-em-role-em-"},{"section":"-em-quota-em-"},{"section":"-em-priorityclass-em-"},{"section":"-em-poddisruptionbudget-em-"},{"section":"-em-namespace-em-"},{"section":"-em-job-em-"},{"section":"-em-deployment-em-"},{"section":"-em-configmap-em-"},{"section":"-em-clusterrolebinding-em-"},{"section":"-em-clusterrole-em-"}]},{"section":"convert","subsections":[]},{"section":"autoscale","subsections":[]},{"section":"annotate","subsections":[]},{"section":"-strong-app-management-strong-","subsections":[]},{"section":"expose","subsections":[]},{"section":"run-container","subsections":[]},{"section":"run","subsections":[]},{"section":"-strong-getting-started-strong-","subsections":[]}],"flatToc":["-strong-deprecated-commands-strong-","plugin","version","options","explain","-em-view-em-","-em-use-context-em-","-em-unset-em-","-em-set-credentials-em-","-em-set-context-em-","-em-set-cluster-em-","-em-set-em-","-em-rename-context-em-","-em-get-contexts-em-","-em-get-clusters-em-","-em-delete-context-em-","-em-delete-cluster-em-","-em-current-context-em-","config","completion","-em-diff-em-","alpha","-strong-kubectl-settings-and-usage-strong-","uncordon","taint","drain","cordon","-em-dump-em-","cluster-info","-em-deny-em-","-em-approve-em-","certificate","api-versions","-strong-cluster-management-strong-","-em-pod-em-","-em-node-em-","top","proxy","port-forward","logs","exec","describe","cp","-em-reconcile-em-","-em-can-i-em-","auth","attach","-strong-working-with-apps-strong-","-em-view-last-applied-em-","-em-set-last-applied-em-","-em-edit-last-applied-em-","apply","-strong-declarative-app-management-strong-","-em-subject-em-","-em-serviceaccount-em--1","-em-selector-em-","-em-resources-em-","-em-image-em-","-em-env-em-","set","scale","-em-undo-em-","-em-status-em-","-em-resume-em-","-em-pause-em-","-em-history-em-","rollout","rolling-update","replace","patch","label","get","edit","delete","-em-serviceaccount-em-","-em-service-nodeport-em-","-em-service-loadbalancer-em-","-em-service-externalname-em-","-em-service-clusterip-em-","-em-service-em-","-em-secret-tls-em-","-em-secret-generic-em-","-em-secret-docker-registry-em-","-em-secret-em-","-em-rolebinding-em-","-em-role-em-","-em-quota-em-","-em-priorityclass-em-","-em-poddisruptionbudget-em-","-em-namespace-em-","-em-job-em-","-em-deployment-em-","-em-configmap-em-","-em-clusterrolebinding-em-","-em-clusterrole-em-","create","convert","autoscale","annotate","-strong-app-management-strong-","expose","run-container","run","-strong-getting-started-strong-"]};})(); \ No newline at end of file +(function(){navData = {"toc":[{"section":"run-container","subsections":[]},{"section":"rolling-update","subsections":[]},{"section":"-strong-deprecated-commands-strong-","subsections":[]},{"section":"version","subsections":[]},{"section":"plugin","subsections":[]},{"section":"options","subsections":[]},{"section":"explain","subsections":[]},{"section":"config","subsections":[{"section":"-em-view-em-"},{"section":"-em-use-context-em-"},{"section":"-em-unset-em-"},{"section":"-em-set-credentials-em-"},{"section":"-em-set-context-em-"},{"section":"-em-set-cluster-em-"},{"section":"-em-set-em-"},{"section":"-em-rename-context-em-"},{"section":"-em-get-contexts-em-"},{"section":"-em-get-clusters-em-"},{"section":"-em-delete-context-em-"},{"section":"-em-delete-cluster-em-"},{"section":"-em-current-context-em-"}]},{"section":"completion","subsections":[]},{"section":"api-resources","subsections":[]},{"section":"alpha","subsections":[{"section":"-em-diff-em-"}]},{"section":"-strong-kubectl-settings-and-usage-strong-","subsections":[]},{"section":"uncordon","subsections":[]},{"section":"taint","subsections":[]},{"section":"drain","subsections":[]},{"section":"cordon","subsections":[]},{"section":"cluster-info","subsections":[{"section":"-em-dump-em-"}]},{"section":"certificate","subsections":[{"section":"-em-deny-em-"},{"section":"-em-approve-em-"}]},{"section":"api-versions","subsections":[]},{"section":"-strong-cluster-management-strong-","subsections":[]},{"section":"top","subsections":[{"section":"-em-pod-em-"},{"section":"-em-node-em-"}]},{"section":"proxy","subsections":[]},{"section":"port-forward","subsections":[]},{"section":"logs","subsections":[]},{"section":"exec","subsections":[]},{"section":"describe","subsections":[]},{"section":"cp","subsections":[]},{"section":"auth","subsections":[{"section":"-em-reconcile-em-"},{"section":"-em-can-i-em-"}]},{"section":"attach","subsections":[]},{"section":"-strong-working-with-apps-strong-","subsections":[]},{"section":"wait","subsections":[]},{"section":"set","subsections":[{"section":"-em-subject-em-"},{"section":"-em-serviceaccount-em--1"},{"section":"-em-selector-em-"},{"section":"-em-resources-em-"},{"section":"-em-image-em-"},{"section":"-em-env-em-"}]},{"section":"scale","subsections":[]},{"section":"rollout","subsections":[{"section":"-em-undo-em-"},{"section":"-em-status-em-"},{"section":"-em-resume-em-"},{"section":"-em-pause-em-"},{"section":"-em-history-em-"}]},{"section":"replace","subsections":[]},{"section":"patch","subsections":[]},{"section":"label","subsections":[]},{"section":"edit","subsections":[]},{"section":"convert","subsections":[]},{"section":"autoscale","subsections":[]},{"section":"annotate","subsections":[]},{"section":"apply","subsections":[{"section":"-em-view-last-applied-em-"},{"section":"-em-set-last-applied-em-"},{"section":"-em-edit-last-applied-em-"}]},{"section":"-strong-app-management-strong-","subsections":[]},{"section":"delete","subsections":[]},{"section":"expose","subsections":[]},{"section":"run","subsections":[]},{"section":"get","subsections":[]},{"section":"create","subsections":[{"section":"-em-serviceaccount-em-"},{"section":"-em-service-nodeport-em-"},{"section":"-em-service-loadbalancer-em-"},{"section":"-em-service-externalname-em-"},{"section":"-em-service-clusterip-em-"},{"section":"-em-service-em-"},{"section":"-em-secret-tls-em-"},{"section":"-em-secret-generic-em-"},{"section":"-em-secret-docker-registry-em-"},{"section":"-em-secret-em-"},{"section":"-em-rolebinding-em-"},{"section":"-em-role-em-"},{"section":"-em-quota-em-"},{"section":"-em-priorityclass-em-"},{"section":"-em-poddisruptionbudget-em-"},{"section":"-em-namespace-em-"},{"section":"-em-job-em-"},{"section":"-em-deployment-em-"},{"section":"-em-configmap-em-"},{"section":"-em-clusterrolebinding-em-"},{"section":"-em-clusterrole-em-"}]},{"section":"-strong-getting-started-strong-","subsections":[]}],"flatToc":["run-container","rolling-update","-strong-deprecated-commands-strong-","version","plugin","options","explain","-em-view-em-","-em-use-context-em-","-em-unset-em-","-em-set-credentials-em-","-em-set-context-em-","-em-set-cluster-em-","-em-set-em-","-em-rename-context-em-","-em-get-contexts-em-","-em-get-clusters-em-","-em-delete-context-em-","-em-delete-cluster-em-","-em-current-context-em-","config","completion","api-resources","-em-diff-em-","alpha","-strong-kubectl-settings-and-usage-strong-","uncordon","taint","drain","cordon","-em-dump-em-","cluster-info","-em-deny-em-","-em-approve-em-","certificate","api-versions","-strong-cluster-management-strong-","-em-pod-em-","-em-node-em-","top","proxy","port-forward","logs","exec","describe","cp","-em-reconcile-em-","-em-can-i-em-","auth","attach","-strong-working-with-apps-strong-","wait","-em-subject-em-","-em-serviceaccount-em--1","-em-selector-em-","-em-resources-em-","-em-image-em-","-em-env-em-","set","scale","-em-undo-em-","-em-status-em-","-em-resume-em-","-em-pause-em-","-em-history-em-","rollout","replace","patch","label","edit","convert","autoscale","annotate","-em-view-last-applied-em-","-em-set-last-applied-em-","-em-edit-last-applied-em-","apply","-strong-app-management-strong-","delete","expose","run","get","-em-serviceaccount-em-","-em-service-nodeport-em-","-em-service-loadbalancer-em-","-em-service-externalname-em-","-em-service-clusterip-em-","-em-service-em-","-em-secret-tls-em-","-em-secret-generic-em-","-em-secret-docker-registry-em-","-em-secret-em-","-em-rolebinding-em-","-em-role-em-","-em-quota-em-","-em-priorityclass-em-","-em-poddisruptionbudget-em-","-em-namespace-em-","-em-job-em-","-em-deployment-em-","-em-configmap-em-","-em-clusterrolebinding-em-","-em-clusterrole-em-","create","-strong-getting-started-strong-"]};})(); \ No newline at end of file diff --git a/static/docs/reference/generated/kubectl/scroll.js b/static/docs/reference/generated/kubectl/scroll.js index 6639f62895..67fee8729e 100644 --- a/static/docs/reference/generated/kubectl/scroll.js +++ b/static/docs/reference/generated/kubectl/scroll.js @@ -187,10 +187,10 @@ $(document).ready(function() { var scrollPosition = $(window).scrollTop(); scrollActions(scrollPosition); checkActiveElement(flatToc, scrollPosition); - // TODO: prevent scroll on sidebar from propagating to window + // TODO: prevent scroll on sidebar from propogating to window $(window).on('scroll', function(event) { var scrollPosition = $(window).scrollTop(); var activeSectionTokens = scrollActions(scrollPosition); var activeElemToken = checkActiveElement(flatToc, scrollPosition); }); -}); +}); \ No newline at end of file