Kubectl annotate command accepts a filename param

This commit is contained in:
feihujiang
2015-08-21 15:08:29 +08:00
parent ebe50ea692
commit 7291bde309
8 changed files with 84 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota) or secrets.
```
kubectl annotate [--overwrite] RESOURCE NAME KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
```
### Examples
@@ -61,6 +61,9 @@ kubectl annotate [--overwrite] RESOURCE NAME KEY_1=VAL_1 ... KEY_N=VAL_N [--reso
# 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'
@@ -79,6 +82,7 @@ $ kubectl annotate pods foo description-
```
--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 annotation
-h, --help[=false]: help for annotate
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
@@ -123,7 +127,7 @@ $ kubectl annotate pods foo description-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.4790376 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 07:07:55.977091863 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]()

View File

@@ -66,7 +66,7 @@ $ kubectl describe nodes kubernetes-minion-emt8.c.myproject.internal
# Describe a pod
$ kubectl describe pods/nginx
# Describe a pod using the data in pod.json.
# Describe a pod identified by type and name in "pod.json"
$ kubectl describe -f pod.json
# Describe all pods
@@ -121,7 +121,7 @@ $ kubectl describe pods frontend
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475314072 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 07:07:55.972896481 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]()