Kubectl patch command accepts a filename param

This commit is contained in:
feihujiang
2015-08-06 17:24:02 +08:00
parent a6148e79c3
commit 0110f3176b
6 changed files with 78 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ JSON and YAML formats are accepted.
Please refer to the models in https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.
```
kubectl patch TYPE NAME -p PATCH
kubectl patch (-f FILENAME | TYPE NAME) -p PATCH
```
### Examples
@@ -55,6 +55,9 @@ kubectl patch TYPE NAME -p PATCH
# Partially update a node using strategic merge patch
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
# Partially update a node identified by the type and name specified in "node.json" using strategic merge patch
kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}'
# Update a container's image; spec.containers[*].name is required because it's a merge key
kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'
```
@@ -62,6 +65,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
### Options
```
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update
-h, --help[=false]: help for patch
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
-p, --patch="": The patch to be applied to the resource JSON file.
@@ -100,7 +104,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 21:51:38.836855054 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-13 02:12:21.577994505 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]()