mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Merge pull request #11184 from caesarxuchao/patch-replace-doc
Auto commit by PR queue bot
This commit is contained in:
commit
7eade1c2ce
@ -18,6 +18,10 @@ Update field(s) of a resource using strategic merge patch
|
|||||||
.PP
|
.PP
|
||||||
JSON and YAML formats are accepted.
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
.PP
|
||||||
|
Please refer to the models in
|
||||||
|
\[la]https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html\[ra] to find if a field is mutable.
|
||||||
|
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.PP
|
.PP
|
||||||
@ -140,6 +144,9 @@ JSON and YAML formats are accepted.
|
|||||||
// Partially update a node using strategic merge patch
|
// Partially update a node using strategic merge patch
|
||||||
kubectl patch node k8s\-node\-1 \-p '{"spec":{"unschedulable":true}}'
|
kubectl patch node k8s\-node\-1 \-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"}]}}'
|
||||||
|
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
@ -18,6 +18,10 @@ Replace a resource by filename or stdin.
|
|||||||
.PP
|
.PP
|
||||||
JSON and YAML formats are accepted.
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
.PP
|
||||||
|
Please refer to the models in
|
||||||
|
\[la]https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html\[ra] to find if a field is mutable.
|
||||||
|
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.PP
|
.PP
|
||||||
|
@ -42,6 +42,8 @@ Update field(s) of a resource using strategic merge patch
|
|||||||
|
|
||||||
JSON and YAML formats are accepted.
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl patch RESOURCE NAME -p PATCH
|
kubectl patch RESOURCE NAME -p PATCH
|
||||||
```
|
```
|
||||||
@ -52,6 +54,9 @@ kubectl patch RESOURCE NAME -p PATCH
|
|||||||
|
|
||||||
// Partially update a node using strategic merge patch
|
// Partially update a node using strategic merge patch
|
||||||
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
|
kubectl patch node k8s-node-1 -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"}]}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
@ -95,7 +100,7 @@ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
|
|||||||
|
|
||||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956026887 +0000 UTC
|
###### Auto generated by spf13/cobra at 2015-08-01 00:12:16.314479678 +0000 UTC
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||||
|
@ -42,6 +42,8 @@ Replace a resource by filename or stdin.
|
|||||||
|
|
||||||
JSON and YAML formats are accepted.
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl replace -f FILENAME
|
kubectl replace -f FILENAME
|
||||||
```
|
```
|
||||||
@ -104,7 +106,7 @@ kubectl replace --force -f ./pod.json
|
|||||||
|
|
||||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132838722 +0000 UTC
|
###### Auto generated by spf13/cobra at 2015-08-01 00:12:16.314376117 +0000 UTC
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||||
|
@ -29,10 +29,15 @@ import (
|
|||||||
const (
|
const (
|
||||||
patch_long = `Update field(s) of a resource using strategic merge patch
|
patch_long = `Update field(s) of a resource using strategic merge patch
|
||||||
|
|
||||||
JSON and YAML formats are accepted.`
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.`
|
||||||
patch_example = `
|
patch_example = `
|
||||||
// Partially update a node using strategic merge patch
|
// Partially update a node using strategic merge patch
|
||||||
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'`
|
kubectl patch node k8s-node-1 -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"}]}}'`
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||||
|
@ -35,7 +35,9 @@ import (
|
|||||||
const (
|
const (
|
||||||
replace_long = `Replace a resource by filename or stdin.
|
replace_long = `Replace a resource by filename or stdin.
|
||||||
|
|
||||||
JSON and YAML formats are accepted.`
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.`
|
||||||
replace_example = `// Replace a pod using the data in pod.json.
|
replace_example = `// Replace a pod using the data in pod.json.
|
||||||
$ kubectl replace -f ./pod.json
|
$ kubectl replace -f ./pod.json
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user