Add command "kubectl replace". "kubectl update" is still supported as an alias.

"kubectl replace --patch" is NOT supported. It's moved to "kubectl patch" as a separate command in another commit.
This commit is contained in:
Chao Xu
2015-06-26 21:25:08 -07:00
parent ad12c98e6d
commit 9b3d42c090
16 changed files with 101 additions and 189 deletions

View File

@@ -19,10 +19,10 @@ kubectl-logs.1
kubectl-namespace.1
kubectl-port-forward.1
kubectl-proxy.1
kubectl-replace.1
kubectl-rolling-update.1
kubectl-run.1
kubectl-scale.1
kubectl-stop.1
kubectl-update.1
kubectl-version.1
kubectl.1

View File

@@ -3,17 +3,17 @@
.SH NAME
.PP
kubectl update \- Update a resource by filename or stdin.
kubectl replace \- Replace a resource by filename or stdin.
.SH SYNOPSIS
.PP
\fBkubectl update\fP [OPTIONS]
\fBkubectl replace\fP [OPTIONS]
.SH DESCRIPTION
.PP
Update a resource by filename or stdin.
Replace a resource by filename or stdin.
.PP
JSON and YAML formats are accepted.
@@ -22,11 +22,11 @@ JSON and YAML formats are accepted.
.SH OPTIONS
.PP
\fB\-\-cascade\fP=false
Only relevant during a force update. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
Only relevant during a force replace. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file to use to update the resource.
Filename, directory, or URL to file to use to replace the resource.
.PP
\fB\-\-force\fP=false
@@ -34,19 +34,15 @@ JSON and YAML formats are accepted.
.PP
\fB\-\-grace\-period\fP=\-1
Only relevant during a force update. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for update
.PP
\fB\-\-patch\fP=""
A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.
help for replace
.PP
\fB\-\-timeout\fP=0
Only relevant during a force update. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object
Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object
.SH OPTIONS INHERITED FROM PARENT COMMANDS
@@ -152,17 +148,14 @@ JSON and YAML formats are accepted.
.RS
.nf
// Update a pod using the data in pod.json.
$ kubectl update \-f pod.json
// Replace a pod using the data in pod.json.
$ kubectl replace \-f pod.json
// Update a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl update \-f \-
// Replace a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl replace \-f \-
// Partially update a node using strategic merge patch
kubectl \-\-api\-version=v1 update node k8s\-node\-1 \-\-patch='\{"spec":\{"unschedulable":true\}\}'
// Force update, delete and then re\-create the resource
kubectl update \-\-force \-f pod.json
// Force replace, delete and then re\-create the resource
kubectl replace \-\-force \-f pod.json
.fi
.RE

View File

@@ -124,7 +124,7 @@ Find more information at
.SH SEE ALSO
.PP
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-update(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP,
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP,
.SH HISTORY