diff --git a/static/docs/reference/generated/kubectl/kubectl-commands.html b/static/docs/reference/generated/kubectl/kubectl-commands.html index f9d567526d..b990856905 100644 --- a/static/docs/reference/generated/kubectl/kubectl-commands.html +++ b/static/docs/reference/generated/kubectl/kubectl-commands.html @@ -11,7 +11,7 @@
- +kubectl create -f docker-registry.yaml --edit -o json
-Create a resource from a file or from stdin.
-JSON and YAML formats are accepted.
+Create a resource from a file or from stdin.
+JSON and YAML formats are accepted.
$ create -f FILENAME
kubectl create configmap my-config --from-env-file=path/to/bar.env
-Create a configmap based on a file, directory, or specified literal value.
-A single configmap may package one or more key/value pairs.
-When creating a configmap based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.
-When creating a configmap based on a directory, each file whose basename is a valid key in the directory will be packaged into the configmap. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).
+Create a configmap based on a file, directory, or specified literal value.
+A single configmap may package one or more key/value pairs.
+When creating a configmap based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.
+When creating a configmap based on a directory, each file whose basename is a valid key in the directory will be packaged into the configmap. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).
$ configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]
++Create a cronjob
+
kubectl create cronjob my-job --image=busybox
+
+++Create a cronjob with command
+
kubectl create cronjob my-job --image=busybox -- date
+
+++Create a cronjob with schedule
+
kubectl create cronjob test-job --image=busybox --schedule="*/1 * * * *"
+
+Create a cronjob with the specified name.
+$ cronjob NAME --image=image --schedule='0/5 * * * ?' -- [COMMAND] [args...]
| Name | +Shorthand | +Default | +Usage | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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. | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image | ++ | + | Image name to run. | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| output | +o | ++ | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file. | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restart | ++ | + | job's restart policy. supported values: OnFailure, Never | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule | ++ | + | A schedule in the Cron format the job should be run with. | +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | @@ -506,7 +599,7 @@ inspect them.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]. | +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 | @@ -535,7 +628,7 @@ inspect them.
| 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]. | +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 | @@ -652,7 +745,7 @@ inspect them.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]. | +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 | @@ -740,7 +833,7 @@ inspect them.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]. | +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 | @@ -822,7 +915,7 @@ inspect them.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]. | +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 | @@ -910,7 +1003,7 @@ inspect them.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]. | +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 | @@ -996,7 +1089,7 @@ inspect them.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]. | +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 | @@ -1091,7 +1184,7 @@ inspect them.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]. | +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 | @@ -1117,7 +1210,7 @@ inspect them.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]. | +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 | @@ -1241,10 +1334,10 @@ inspect them.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]. | +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 | @@ -1339,8 +1432,8 @@ inspect them.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]. | +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 | @@ -1493,7 +1586,7 @@ inspect them.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]. | +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 | @@ -1510,8 +1603,8 @@ inspect them.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]. | +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 | @@ -1642,7 +1735,7 @@ inspect them.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]. | +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 | @@ -1719,7 +1812,7 @@ inspect them.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]. | +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 | @@ -1784,7 +1877,7 @@ inspect them.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]. | +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 | @@ -1827,11 +1920,21 @@ inspect them.|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| all-namespaces | -+ | A | false | If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. | If 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kustomize | +k | ++ | Process the kustomization directory. This flag can't be used together with -f or -R. | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label-columns | L | [] | @@ -1923,7 +2032,7 @@ inspect them.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: 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]. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| raw | @@ -1950,12 +2059,6 @@ inspect them.If true, have the server return the appropriate table output. Supports extension APIs and CRDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show-all | -a | -true | -When printing, show all resources (default show all pods including terminated one.) | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show-kind | false | @@ -1977,7 +2080,7 @@ inspect them.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]. | +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]. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use-openapi-print-columns | @@ -2061,8 +2164,8 @@ inspect them.The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kustomize | +k | ++ | Process a kustomization directory. This flag can't be used together with -f or -R. | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels | l | @@ -2284,7 +2393,7 @@ inspect them. | 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]. | +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]. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout | @@ -2331,7 +2440,7 @@ inspect them.The 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'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kustomize | +k | ++ | Process the kustomization directory. This flag can't be used together with -f or -R. | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels | l | @@ -2484,7 +2599,7 @@ inspect them. | 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]. | +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 | @@ -2502,6 +2617,11 @@ inspect them.
| Delete all resources, including uninitialized ones, in the namespace of the specified resource types. | |||
| all-namespaces | +A | +false | +If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. | +
| cascade | true | @@ -2598,6 +2724,12 @@ inspect them.If 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. | |
| kustomize | +k | ++ | Process a kustomization directory. This flag can't be used together with -f or -R. | +
| now | false | @@ -2635,48 +2767,6 @@ inspect them.
--Diff resources included in pod.json.
-
kubectl diff -f pod.json
-
---Diff file read from stdin
-
cat service.yaml | kubectl diff -f -
-
-Diff configurations specified by filename or stdin between the current online configuration, and the configuration as it would be if applied.
-Output is always YAML.
-KUBECTL EXTERNAL DIFF environment variable can be used to select your own diff command. By default, the "diff" command available in your path will be run with "-u" (unicode) and "-N" (treat new files as empty) options.
-$ diff -f FILENAME
| Name | -Shorthand | -Default | -Usage | -
|---|---|---|---|
| filename | -f | -[] | -Filename, directory, or URL to files contains the configuration to diff | -
| recursive | -R | -false | -Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | -
This section contains commands for creating, updating, deleting, and viewing your workloads in a Kubernetes cluster.
@@ -2688,6 +2778,11 @@ viewing your workloads in a Kubernetes cluster.kubectl apply -f ./pod.json
++Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml.
+
kubectl apply -k dir/
+
+Apply the JSON passed into stdin to a pod.
cat pod.json | kubectl apply -f -
@@ -2702,11 +2797,11 @@ viewing your workloads in a Kubernetes cluster.
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.
+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
+$ apply (-f FILENAME | -k DIRECTORY)
Flags
@@ -2740,7 +2835,25 @@ viewing your workloads in a Kubernetes cluster.
dry-run
false
-If true, only print the object that would be sent, without sending it.
+If true, only print the object that would be sent, without sending it. Warning: --dry-run cannot accurately output the result of merging the local manifest and the server-side data. Use --server-dry-run to get the merged result instead.
+
+
+experimental-field-manager
+
+kubectl
+Name of the manager used to track field ownership. This is an alpha feature and flag.
+
+
+experimental-force-conflicts
+
+false
+If true, server-side apply will force the changes against conflicts. This is an alpha feature and flag.
+
+
+experimental-server-side
+
+false
+If true, apply runs in the server instead of the client. This is an alpha feature and flag.
filename
@@ -2767,6 +2880,12 @@ viewing your workloads in a Kubernetes cluster.
If 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.
+kustomize
+k
+
+Process a kustomization directory. This flag can't be used together with -f or -R.
+
+
openapi-patch
true
@@ -2824,7 +2943,7 @@ viewing your workloads in a Kubernetes cluster.
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].
+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].
timeout
@@ -2858,11 +2977,11 @@ viewing your workloads in a Kubernetes cluster.
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.
+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
@@ -2895,6 +3014,12 @@ viewing your workloads in a Kubernetes cluster.
If 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.
+kustomize
+k
+
+Process the kustomization directory. This flag can't be used together with -f or -R.
+
+
output
o
@@ -2916,7 +3041,7 @@ viewing your workloads in a Kubernetes cluster.
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].
+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].
windows-line-endings
@@ -2943,7 +3068,7 @@ viewing your workloads in a Kubernetes cluster.
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.
+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
@@ -2991,7 +3116,7 @@ viewing your workloads in a Kubernetes cluster.
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].
+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].
@@ -3007,8 +3132,8 @@ viewing your workloads in a Kubernetes cluster.
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.
+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
@@ -3035,6 +3160,12 @@ viewing your workloads in a Kubernetes cluster.
Filename, directory, or URL to files that contains the last-applied-configuration annotations
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.
+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.
$ annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
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, StatefulSet, 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.
+Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster.
+Looks up a Deployment, ReplicaSet, StatefulSet, 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.
$ autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]
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.
+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.
$ convert -f FILENAME
++Diff resources included in pod.json.
+
kubectl diff -f pod.json
+
+++Diff file read from stdin
+
cat service.yaml | kubectl diff -f -
+
+Diff configurations specified by filename or stdin between the current online configuration, and the configuration as it would be if applied.
+Output is always YAML.
+KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own diff command. By default, the "diff" command available in your path will be run with "-u" (unicode) and "-N" (treat new files as empty) options.
+$ diff -f FILENAME
| Name | +Shorthand | +Default | +Usage | +
|---|---|---|---|
| experimental-field-manager | ++ | kubectl | +Name of the manager used to track field ownership. This is an alpha feature and flag. | +
| experimental-force-conflicts | ++ | false | +If true, server-side apply will force the changes against conflicts. This is an alpha feature and flag. | +
| experimental-server-side | ++ | false | +If true, apply runs in the server instead of the client. This is an alpha feature and flag. | +
| filename | +f | +[] | +Filename, directory, or URL to files contains the configuration to diff | +
| kustomize | +k | ++ | Process the kustomization directory. This flag can't be used together with -f or -R. | +
| recursive | +R | +false | +Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | +
Edit the service named 'docker-registry':
@@ -3401,12 +3616,12 @@ viewing your workloads in a Kubernetes cluster.
kubectl edit deployment/mydeployment -o yaml --save-config
-Edit a resource from the default editor.
-The edit 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.
-Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.
-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.
+Edit a resource from the default editor.
+The edit 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.
+Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.
+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.
$ edit (RESOURCE/NAME | -f FILENAME)
kubectl label pods foo bar-
-Update the labels on a resource.
+Update the labels on a resource.
kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]'
-Update field(s) of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.
-JSON and YAML formats are accepted.
-Please refer to the models in https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/docs/api-reference/v1/definitions.html to find if a field is mutable.
+Update field(s) of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.
+JSON and YAML formats are accepted.
$ patch (-f FILENAME | TYPE NAME) -p PATCH
kubectl replace --force -f ./pod.json
-Replace a resource by filename or stdin.
-JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by
+Replace a resource by filename or stdin.
+JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by
$ kubectl get TYPE NAME -o yaml
-Please refer to the models in https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/docs/api-reference/v1/definitions.html to find if a field is mutable.
$ replace -f FILENAME
kubectl rollout status daemonset/foo
Manage the rollout of a resource.
-Valid resource types include:
+Valid resource types include:
kubectl rollout pause deployment/nginx
-Mark the provided resource as paused
-Paused resources will not be reconciled by a controller. Use "kubectl rollout resume" to resume a paused resource. Currently only deployments support being paused.
+Mark the provided resource as paused
+Paused resources will not be reconciled by a controller. Use "kubectl rollout resume" to resume a paused resource. Currently only deployments support being paused.
$ pause RESOURCE
kubectl rollout resume deployment/nginx
-Resume a paused resource
-Paused resources will not be reconciled by a controller. By resuming a resource, we allow it to be reconciled again. Currently only deployments support being resumed.
+Resume a paused resource
+Paused resources will not be reconciled by a controller. By resuming a resource, we allow it to be reconciled again. Currently only deployments support being resumed.
$ resume RESOURCE
kubectl rollout status deployment/nginx
-Show the status of the rollout.
-By default 'rollout status' will watch the status of the latest rollout until it's done. If you don't want to wait for the rollout to finish then you can use --watch=false. Note that if a new rollout starts in-between, then 'rollout status' will continue watching the latest revision. If you want to pin to a specific revision and abort if it is rolled over by another revision, use --revision=N where N is the revision you need to watch for.
+Show the status of the rollout.
+By default 'rollout status' will watch the status of the latest rollout until it's done. If you don't want to wait for the rollout to finish then you can use --watch=false. Note that if a new rollout starts in-between, then 'rollout status' will continue watching the latest revision. If you want to pin to a specific revision and abort if it is rolled over by another revision, use --revision=N where N is the revision you need to watch for.
$ status (TYPE NAME | TYPE/NAME) [flags]
kubectl scale --replicas=3 statefulset/web
-Set a new size for a Deployment, ReplicaSet, Replication Controller, or StatefulSet.
-Scale also allows users to specify one or more preconditions for the scale action.
-If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.
+Set a new size for a Deployment, ReplicaSet, Replication Controller, or StatefulSet.
+Scale also allows users to specify one or more preconditions for the scale action.
+If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.
$ scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)
Configure application resources
-These commands help you make changes to existing application resources.
+Configure application resources
+These commands help you make changes to existing application resources.
$ set SUBCOMMAND
env | grep RAILS_ | kubectl set env -e - deployment/registry
-Update environment variables on a pod template.
-List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod templates (within replication controllers or deployment configurations). View or modify the environment variable definitions on all containers in the specified pods or pod templates, or just those that match a wildcard.
-If "--env -" is passed, environment variables can be read from STDIN using the standard env syntax.
-Possible resources include (case insensitive):
+Update environment variables on a pod template.
+List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod templates (within replication controllers or deployment configurations). View or modify the environment variable definitions on all containers in the specified pods or pod templates, or just those that match a wildcard.
+If "--env -" is passed, environment variables can be read from STDIN using the standard env syntax.
+Possible resources include (case insensitive):
pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs)
$ env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N
kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
-Update existing container image(s) of resources.
-Possible resources include (case insensitive):
+Update existing container image(s) of resources.
+Possible resources include (case insensitive):
pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), replicaset (rs)
$ image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N
kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
-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): Use "kubectl api-resources" for a complete list of supported resources..
+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): Use "kubectl api-resources" for a complete list of supported resources..
$ resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]
kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
kubectl create deployment my-dep -o yaml --dry-run | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -
-Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.
-A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.
+Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.
+A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.
$ selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]
kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
-Update ServiceAccount of pod template resources.
-Possible resources (case insensitive) can be:
-replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset
+Update ServiceAccount of pod template resources.
+Possible resources (case insensitive) can be:
+replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset
$ serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT
kubectl delete pod/busybox1
kubectl wait --for=delete pod/busybox1 --timeout=60s
-Experimental: Wait for a specific condition on one or many resources.
-The command takes multiple resources and waits until the specified condition is seen in the Status field of every given resource.
-Alternatively, the command can wait for the given set of resources to be deleted by providing the "delete" keyword as the value to the --for flag.
-A successful message will be printed to stdout indicating when the specified condition has been met. One can use -o option to change to output destination.
+Experimental: Wait for a specific condition on one or many resources.
+The command takes multiple resources and waits until the specified condition is seen in the Status field of every given resource.
+Alternatively, the command can wait for the given set of resources to be deleted by providing the "delete" keyword as the value to the --for flag.
+A successful message will be printed to stdout indicating when the specified condition has been met. One can use -o option to change to output destination.
$ wait resource.group/name [--for=delete|--for condition=available]
$ wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available]
| all-namespaces | +all | false | +Select all resources in the namespace of the specified resource types | +||||
| all-namespaces | +A | +false | If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. | ||||
| 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. | |||||||
| 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 | [] | @@ -5066,7 +5375,7 @@ kubectl wait --fortemplate | - | 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]. | +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]. | |
| timeout | @@ -5183,8 +5492,13 @@ applications.|||||||
| all-namespaces | -+ | A | false | If true, check the specified action in all namespaces. | |||
| list | ++ | false | +If true, prints all allowed actions. | +||||
| no-headers | ++ | false | +If true, prints allowed actions without headers | +||||
| quiet | q | false | @@ -5225,8 +5551,11 @@ applications.Filename, directory, or URL to files identifying the resource to reconcile. | ||||
| kustomize | +k | ++ | Process the kustomization directory. This flag can't be used together with -f or -R. | +||||
| output | o | @@ -5286,7 +5621,7 @@ applications. | 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]. | +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]. |
kubectl describe pods frontend
-Show details of a specific resource or group of resources
-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:
+Show details of a specific resource or group of resources
+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.
+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.
Use "kubectl api-resources" for a complete list of supported resources.
$ describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)
kubectl logs -f -c ruby web-1
++Begin streaming the logs from all containers in pods defined by label app=nginx
+
kubectl logs -f -lapp=nginx --all-containers=true
+
+Display only the most recent 20 lines of output in pod nginx
kubectl logs --tail=20 nginx
@@ -5576,6 +5922,12 @@ applications.
Maximum bytes of logs to return. Defaults to no limit.
kubectl port-forward pod/mypod :5000
-Forward one or more local ports to a pod.
-Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
-If there are multiple pods matching the criteria, a pod will be selected automatically. The forwarding session ends when the selected pod terminates, and rerun of the command is needed to resume forwarding.
+Forward one or more local ports to a pod. This command requires the node to have 'socat' installed.
+Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
+If there are multiple pods matching the criteria, a pod will be selected automatically. The forwarding session ends when the selected pod terminates, and rerun of the command is needed to resume forwarding.
$ port-forward TYPE/NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
Display Resource (CPU/Memory/Storage) usage.
-The top command allows you to see the resource consumption for nodes or pods.
-This command requires Heapster to be correctly configured and working on the server.
+Display Resource (CPU/Memory/Storage) usage.
+The top command allows you to see the resource consumption for nodes or pods.
+This command requires Heapster to be correctly configured and working on the server.
$ top
kubectl top node NODE_NAME
-Display Resource (CPU/Memory/Storage) usage of nodes.
-The top-node command allows you to see the resource consumption of nodes.
+Display Resource (CPU/Memory/Storage) usage of nodes.
+The top-node command allows you to see the resource consumption of nodes.
$ node [NAME | -l label]
kubectl top pod -l name=myLabel
-Display Resource (CPU/Memory/Storage) usage of pods.
-The 'top pod' command allows you to see the resource consumption of pods.
-Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.
+Display Resource (CPU/Memory/Storage) usage of pods.
+The 'top pod' command allows you to see the resource consumption of pods.
+Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.
$ pod [NAME | -l label]
$ certificate SUBCOMMAND
Approve a certificate signing request.
-kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requestor with the attributes requested in the CSR.
-SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.
+Approve a certificate signing request.
+kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requestor with the attributes requested in the CSR.
+SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.
$ approve (-f FILENAME | NAME)
Deny a certificate signing request.
-kubectl certificate deny allows a cluster admin to deny a certificate signing request (CSR). This action tells a certificate signing controller to not to issue a certificate to the requestor.
+Deny a certificate signing request.
+kubectl certificate deny allows a cluster admin to deny a certificate signing request (CSR). This action tells a certificate signing controller to not to issue a certificate to the requestor.
$ deny (-f FILENAME | NAME)
kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state
-Dumps cluster info out suitable for debugging and diagnosing cluster problems. By default, dumps everything to stdout. You can optionally specify a directory with --output-directory. If you specify a directory, kubernetes will build a set of files in that directory. By default only dumps things in the 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.
-The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories based on namespace and pod name.
+Dumps cluster info out suitable for debugging and diagnosing cluster problems. By default, dumps everything to stdout. You can optionally specify a directory with --output-directory. If you specify a directory, kubernetes will build a set of files in that directory. By default only dumps things in the 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.
+The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories based on namespace and pod name.
$ dump
$ kubectl drain foo --grace-period=900
-Drain node in preparation for maintenance.
-The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the APIServer supports http://kubernetes.io/docs/admin/disruptions/. Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are DaemonSet-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any DaemonSet-managed pods, because those pods would be immediately replaced by the DaemonSet controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by ReplicationController, ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.
-'drain' waits for graceful termination. You should not operate on the machine until the command completes.
-When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.
-! http://kubernetes.io/images/docs/kubectl_drain.svg
+Drain node in preparation for maintenance.
+The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the APIServer supportshttp://kubernetes.io/docs/admin/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are DaemonSet-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any DaemonSet-managed pods, because those pods would be immediately replaced by the DaemonSet controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by ReplicationController, ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.
+'drain' waits for graceful termination. You should not operate on the machine until the command completes.
+When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.
+http://kubernetes.io/images/docs/kubectl_drain.svg
$ drain NODE
kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule
-Update the taints on one or more nodes.
+Update the taints on one or more nodes.
kubectl completion zsh > "${fpath[1]}/_kubectl"
-Output shell completion code for the specified shell (bash or zsh). The shell code must be evaluated to provide interactive completion of kubectl commands. This can be done by sourcing it from the .bash _profile.
-Detailed instructions on how to do this are available here: https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion
-Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
+Output shell completion code for the specified shell (bash or zsh). The shell code must be evaluated to provide interactive completion of kubectl commands. This can be done by sourcing it from the .bash_profile.
+Detailed instructions on how to do this are available here: https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion
+Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
$ completion SHELL
Modify kubeconfig files using subcommands like "kubectl config set current-context my-context"
-The loading order follows these rules:
+Modify kubeconfig files using subcommands like "kubectl config set current-context my-context"
+The loading order follows these rules:
kubectl config rename-context old-name new-name
-Renames a context from the kubeconfig file.
-CONTEXT _NAME is the context name that you wish change.
-NEW _NAME is the new name you wish to set.
-Note: In case the context being renamed is the 'current-context', this field will also be updated.
+Renames a context from the kubeconfig file.
+CONTEXT_NAME is the context name that you wish change.
+NEW_NAME is the new name you wish to set.
+Note: In case the context being renamed is the 'current-context', this field will also be updated.
$ rename-context CONTEXT_NAME NEW_NAME
Sets an individual value in a kubeconfig file
-PROPERTY _NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
-PROPERTY _VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.
+++Set server field on the my-cluster cluster to https://1.2.3.4
+
kubectl config set clusters.my-cluster.server https://1.2.3.4
+
+++Set certificate-authority-data field on the my-cluster cluster.
+
kubectl config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)
+
+++Set cluster field in the my-context context to my-cluster.
+
kubectl config set contexts.my-context.cluster my-cluster
+
+++Set client-key-data field in the cluster-admin user using --set-raw-bytes option.
+
kubectl config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true
+
+Sets an individual value in a kubeconfig file
+PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
+PROPERTY_VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.
+Specifying a attribute name that already exists will merge new fields on top of existing values.
$ set PROPERTY_NAME PROPERTY_VALUE
kubectl config set-cluster e2e --insecure-skip-tls-verify=true
-Sets a cluster entry in kubeconfig.
-Specifying a name that already exists will merge new fields on top of existing values for those fields.
+Sets a cluster entry in kubeconfig.
+Specifying a name that already exists will merge new fields on top of existing values for those fields.
$ set-cluster NAME [--server=server] [--certificate-authority=path/to/certificate/authority] [--insecure-skip-tls-verify=true]
kubectl config set-context gce --user=cluster-admin
-Sets a context entry in kubeconfig
-Specifying a name that already exists will merge new fields on top of existing values for those fields.
+Sets a context entry in kubeconfig
+Specifying a name that already exists will merge new fields on top of existing values for those fields.
$ set-context [NAME | --current] [--cluster=cluster_nickname] [--user=user_nickname] [--namespace=namespace]
kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-
-Sets a user entry in kubeconfig
-Specifying a name that already exists will merge new fields on top of existing values.
+Sets a user entry in kubeconfig
+Specifying a name that already exists will merge new fields on top of existing values.
Client-certificate flags: --client-certificate=certfile --client-key=keyfile
Bearer token flags: --token=bearer_token
Basic auth flags: --username=basic_user --password=basic_password
-Bearer token and basic auth are mutually exclusive.
+Bearer token and basic auth are mutually exclusive.
$ set-credentials NAME [--client-certificate=path/to/certfile] [--client-key=path/to/keyfile] [--token=bearer_token] [--username=basic_user] [--password=basic_password] [--auth-provider=provider_name] [--auth-provider-arg=key=value]
kubectl config unset contexts.foo.namespace
-Unsets an individual value in a kubeconfig file
-PROPERTY _NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
+Unsets an individual value in a kubeconfig file
+PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
$ unset PROPERTY_NAME
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
-Display merged kubeconfig settings or a specified kubeconfig file.
-You can use --output jsonpath={...} to extract specific values using a jsonpath expression.
+Display merged kubeconfig settings or a specified kubeconfig file.
+You can use --output jsonpath={...} to extract specific values using a jsonpath expression.
$ view
kubectl explain pods.spec.containers
-List the fields for supported resources
-This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:
+List the fields for supported resources
+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.
+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.
Use "kubectl api-resources" for a complete list of supported resources.
$ explain RESOURCE
++Use the current working directory
+
kubectl%20kustomize%20.
+
+++Use some shared configuration directory
+
kubectl kustomize /home/configuration/production
+
+++Use a URL
+
kubectl kustomize github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6
+
+Print a set of API resources generated from instructions in a kustomization.yaml file.
+The argument must be the path to the directory containing the file, or a git repository URL with a path suffix specifying same with respect to the repository root.
+kubectl kustomize somedir
+$ kustomize <dir>
Print flags inherited by all commands
@@ -7001,14 +7396,14 @@ source $HOME/.bash_profile
$ options
plugin
-Provides utilities for interacting with plugins.
-Plugins provide extended functionality that is not part of the major command-line distribution. Please refer to the documentation and examples for more information about how write your own plugins.
+Provides utilities for interacting with plugins.
+Plugins provide extended functionality that is not part of the major command-line distribution. Please refer to the documentation and examples for more information about how write your own plugins.
Usage
$ plugin [flags]
list
-List all available plugin files on a user's PATH.
-Available plugin files are those that are: - executable - anywhere on the user's PATH - begin with "kubectl-"
+List all available plugin files on a user's PATH.
+Available plugin files are those that are: - executable - anywhere on the user's PATH - begin with "kubectl-"
Usage
$ listFlags
@@ -7099,9 +7494,9 @@ source $HOME/.bash_profile
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
+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
$ rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)