This keeps new pods from landing on the node while you are trying to get them off.
This keeps new pods from landing on the node while you are trying to get them off.
1. Get the pods off the machine, via any of the following strategies:
1. Get the pods off the machine, via any of the following strategies:
1. wait for finite-duration pods to complete
1. wait for finite-duration pods to complete
...
@@ -53,7 +53,7 @@ If you want more control over the upgrading process, you may use the following w
...
@@ -53,7 +53,7 @@ If you want more control over the upgrading process, you may use the following w
1. for pods with no replication controller, you need to bring up a new copy of the pod, and assuming it is not part of a service, redirect clients to it.
1. for pods with no replication controller, you need to bring up a new copy of the pod, and assuming it is not part of a service, redirect clients to it.
// Force update, delete and then re-create the resource
kubectl update --force -f pod.json
```
```
### Options
### Options
```
```
--cascade=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.
--cascade=false: 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.
-f, --filename=[]: Filename, directory, or URL to file to use to update the resource.
-f, --filename=[]: Filename, directory, or URL to file to use to replace the resource.
--force=false: Delete and re-create the specified resource
--force=false: Delete and re-create the specified resource
--grace-period=-1: Only relevant during a force update. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
--grace-period=-1: Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
-h, --help=false: help for update
-h, --help=false: help for replace
--patch="": A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.
--timeout=0: 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
--timeout=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
kubectl update \- Update a resource by filename or stdin.
kubectl replace \- Replace a resource by filename or stdin.
.SH SYNOPSIS
.SH SYNOPSIS
.PP
.PP
\fBkubectl update\fP [OPTIONS]
\fBkubectl replace\fP [OPTIONS]
.SH DESCRIPTION
.SH DESCRIPTION
.PP
.PP
Update a resource by filename or stdin.
Replace a resource by filename or stdin.
.PP
.PP
JSON and YAML formats are accepted.
JSON and YAML formats are accepted.
...
@@ -22,11 +22,11 @@ JSON and YAML formats are accepted.
...
@@ -22,11 +22,11 @@ JSON and YAML formats are accepted.
.SH OPTIONS
.SH OPTIONS
.PP
.PP
\fB\-\-cascade\fP=false
\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
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
\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
.PP
\fB\-\-force\fP=false
\fB\-\-force\fP=false
...
@@ -34,19 +34,15 @@ JSON and YAML formats are accepted.
...
@@ -34,19 +34,15 @@ JSON and YAML formats are accepted.
.PP
.PP
\fB\-\-grace\-period\fP=\-1
\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
.PP
\fB\-h\fP, \fB\-\-help\fP=false
\fB\-h\fP, \fB\-\-help\fP=false
help for update
help for replace
.PP
\fB\-\-patch\fP=""
A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.
.PP
.PP
\fB\-\-timeout\fP=0
\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
.SH OPTIONS INHERITED FROM PARENT COMMANDS
...
@@ -152,17 +148,14 @@ JSON and YAML formats are accepted.
...
@@ -152,17 +148,14 @@ JSON and YAML formats are accepted.
.RS
.RS
.nf
.nf
// Update a pod using the data in pod.json.
// Replace a pod using the data in pod.json.
$ kubectl update \-f pod.json
$ kubectl replace \-f pod.json
// Update a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl update \-f \-
// Partially update a node using strategic merge patch
// Replace a pod based on the JSON passed into stdin.
usage:="Filename, directory, or URL to file to use to update the resource."
usage:="Filename, directory, or URL to file to use to replace the resource."
kubectl.AddJsonFilenameFlag(cmd,&filenames,usage)
kubectl.AddJsonFilenameFlag(cmd,&filenames,usage)
cmd.MarkFlagRequired("filename")
cmd.MarkFlagRequired("filename")
cmd.Flags().String("patch","","A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.")
cmd.MarkFlagRequired("patch")
cmd.Flags().Bool("force",false,"Delete and re-create the specified resource")
cmd.Flags().Bool("force",false,"Delete and re-create the specified resource")
cmd.Flags().Bool("cascade",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.")
cmd.Flags().Bool("cascade",false,"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.")
cmd.Flags().Int("grace-period",-1,"Only relevant during a force update. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.")
cmd.Flags().Int("grace-period",-1,"Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.")
cmd.Flags().Duration("timeout",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")
cmd.Flags().Duration("timeout",0,"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")