Merge pull request #12326 from feihujiang/kubectlLabelAcceptFileNameParam
Kubectl label command accepts a filename param
This commit is contained in:
@@ -45,7 +45,7 @@ If --overwrite is true, then existing labels can be overwritten, otherwise attem
|
||||
If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used.
|
||||
|
||||
```
|
||||
kubectl label [--overwrite] TYPE NAME KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
|
||||
kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@@ -60,6 +60,9 @@ $ kubectl label --overwrite pods foo status=unhealthy
|
||||
# Update all pods in the namespace
|
||||
$ kubectl label pods --all status=unhealthy
|
||||
|
||||
# Update a pod identified by the type and name in "pod.json"
|
||||
$ kubectl label -f pod.json status=unhealthy
|
||||
|
||||
# Update pod 'foo' only if the resource is unchanged from version 1.
|
||||
$ kubectl label pods foo status=unhealthy --resource-version=1
|
||||
|
||||
@@ -72,6 +75,7 @@ $ kubectl label pods foo bar-
|
||||
|
||||
```
|
||||
--all[=false]: select all resources in the namespace of the specified resource types
|
||||
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the labels
|
||||
-h, --help[=false]: help for label
|
||||
--no-headers[=false]: When using the default output, don't print headers.
|
||||
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
|
||||
@@ -116,7 +120,7 @@ $ kubectl label pods foo bar-
|
||||
|
||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||
|
||||
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.309176995 +0000 UTC
|
||||
###### Auto generated by spf13/cobra at 2015-08-13 02:21:16.349210188 +0000 UTC
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
|
Reference in New Issue
Block a user