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. 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
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
// Force replace, delete and then re-create the resource
kubectl replace --force -f pod.json
```
### 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.
-f, --filename=[]: Filename, directory, or URL to file to use to update the resource.
--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 replace the 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.
-h, --help=false: help for update
--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 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
--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 replace
--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
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
// Update a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl update \-f \-
// Replace a pod using the data in pod.json.
$ kubectl replace \-f pod.json
// Partially update a node using strategic merge patch
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)
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("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().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().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().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 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 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")