... | ... |
@@ -344,6 +344,12 @@ Manage nodes - list pods, evacuate, or mark ready |
344 | 344 |
# Migrate selected pods |
345 | 345 |
oadm manage-node <mynode> --evacuate --pod-selector="<service=myapp>" |
346 | 346 |
|
347 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
348 |
+ oadm manage-node <mynode> --evacuate --grace-period=60 --pod-selector="<service=myapp>" |
|
349 |
+ |
|
350 |
+ # Migrate selected pods not backed by replication controller |
|
351 |
+ oadm manage-node <mynode> --evacuate --force --pod-selector="<service=myapp>" |
|
352 |
+ |
|
347 | 353 |
# Show pods that will be migrated |
348 | 354 |
oadm manage-node <mynode> --evacuate --dry-run --pod-selector="<service=myapp>" |
349 | 355 |
|
... | ... |
@@ -344,6 +344,12 @@ Manage nodes - list pods, evacuate, or mark ready |
344 | 344 |
# Migrate selected pods |
345 | 345 |
oc adm manage-node <mynode> --evacuate --pod-selector="<service=myapp>" |
346 | 346 |
|
347 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
348 |
+ oc adm manage-node <mynode> --evacuate --grace-period=60 --pod-selector="<service=myapp>" |
|
349 |
+ |
|
350 |
+ # Migrate selected pods not backed by replication controller |
|
351 |
+ oc adm manage-node <mynode> --evacuate --force --pod-selector="<service=myapp>" |
|
352 |
+ |
|
347 | 353 |
# Show pods that will be migrated |
348 | 354 |
oc adm manage-node <mynode> --evacuate --dry-run --pod-selector="<service=myapp>" |
349 | 355 |
|
... | ... |
@@ -44,7 +44,7 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
44 | 44 |
|
45 | 45 |
.PP |
46 | 46 |
\fB\-\-grace\-period\fP=30 |
47 |
- Grace period (seconds) for pods being deleted. Optional param for \-\-evacuate |
|
47 |
+ Grace period (seconds) for pods being deleted. Ignored if negative. Optional param for \-\-evacuate |
|
48 | 48 |
|
49 | 49 |
.PP |
50 | 50 |
\fB\-\-list\-pods\fP=false |
... | ... |
@@ -174,6 +174,12 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
174 | 174 |
# Migrate selected pods |
175 | 175 |
oadm manage\-node <mynode> \-\-evacuate \-\-pod\-selector="<service=myapp>" |
176 | 176 |
|
177 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
178 |
+ oadm manage\-node <mynode> \-\-evacuate \-\-grace\-period=60 \-\-pod\-selector="<service=myapp>" |
|
179 |
+ |
|
180 |
+ # Migrate selected pods not backed by replication controller |
|
181 |
+ oadm manage\-node <mynode> \-\-evacuate \-\-force \-\-pod\-selector="<service=myapp>" |
|
182 |
+ |
|
177 | 183 |
# Show pods that will be migrated |
178 | 184 |
oadm manage\-node <mynode> \-\-evacuate \-\-dry\-run \-\-pod\-selector="<service=myapp>" |
179 | 185 |
|
... | ... |
@@ -44,7 +44,7 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
44 | 44 |
|
45 | 45 |
.PP |
46 | 46 |
\fB\-\-grace\-period\fP=30 |
47 |
- Grace period (seconds) for pods being deleted. Optional param for \-\-evacuate |
|
47 |
+ Grace period (seconds) for pods being deleted. Ignored if negative. Optional param for \-\-evacuate |
|
48 | 48 |
|
49 | 49 |
.PP |
50 | 50 |
\fB\-\-list\-pods\fP=false |
... | ... |
@@ -174,6 +174,12 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
174 | 174 |
# Migrate selected pods |
175 | 175 |
oc adm manage\-node <mynode> \-\-evacuate \-\-pod\-selector="<service=myapp>" |
176 | 176 |
|
177 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
178 |
+ oc adm manage\-node <mynode> \-\-evacuate \-\-grace\-period=60 \-\-pod\-selector="<service=myapp>" |
|
179 |
+ |
|
180 |
+ # Migrate selected pods not backed by replication controller |
|
181 |
+ oc adm manage\-node <mynode> \-\-evacuate \-\-force \-\-pod\-selector="<service=myapp>" |
|
182 |
+ |
|
177 | 183 |
# Show pods that will be migrated |
178 | 184 |
oc adm manage\-node <mynode> \-\-evacuate \-\-dry\-run \-\-pod\-selector="<service=myapp>" |
179 | 185 |
|
... | ... |
@@ -44,7 +44,7 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
44 | 44 |
|
45 | 45 |
.PP |
46 | 46 |
\fB\-\-grace\-period\fP=30 |
47 |
- Grace period (seconds) for pods being deleted. Optional param for \-\-evacuate |
|
47 |
+ Grace period (seconds) for pods being deleted. Ignored if negative. Optional param for \-\-evacuate |
|
48 | 48 |
|
49 | 49 |
.PP |
50 | 50 |
\fB\-\-list\-pods\fP=false |
... | ... |
@@ -174,6 +174,12 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
174 | 174 |
# Migrate selected pods |
175 | 175 |
openshift admin manage\-node <mynode> \-\-evacuate \-\-pod\-selector="<service=myapp>" |
176 | 176 |
|
177 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
178 |
+ openshift admin manage\-node <mynode> \-\-evacuate \-\-grace\-period=60 \-\-pod\-selector="<service=myapp>" |
|
179 |
+ |
|
180 |
+ # Migrate selected pods not backed by replication controller |
|
181 |
+ openshift admin manage\-node <mynode> \-\-evacuate \-\-force \-\-pod\-selector="<service=myapp>" |
|
182 |
+ |
|
177 | 183 |
# Show pods that will be migrated |
178 | 184 |
openshift admin manage\-node <mynode> \-\-evacuate \-\-dry\-run \-\-pod\-selector="<service=myapp>" |
179 | 185 |
|
... | ... |
@@ -44,7 +44,7 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
44 | 44 |
|
45 | 45 |
.PP |
46 | 46 |
\fB\-\-grace\-period\fP=30 |
47 |
- Grace period (seconds) for pods being deleted. Optional param for \-\-evacuate |
|
47 |
+ Grace period (seconds) for pods being deleted. Ignored if negative. Optional param for \-\-evacuate |
|
48 | 48 |
|
49 | 49 |
.PP |
50 | 50 |
\fB\-\-list\-pods\fP=false |
... | ... |
@@ -174,6 +174,12 @@ list\-pods: List all/selected pods on given/selected nodes. It can list the outp |
174 | 174 |
# Migrate selected pods |
175 | 175 |
openshift cli adm manage\-node <mynode> \-\-evacuate \-\-pod\-selector="<service=myapp>" |
176 | 176 |
|
177 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
178 |
+ openshift cli adm manage\-node <mynode> \-\-evacuate \-\-grace\-period=60 \-\-pod\-selector="<service=myapp>" |
|
179 |
+ |
|
180 |
+ # Migrate selected pods not backed by replication controller |
|
181 |
+ openshift cli adm manage\-node <mynode> \-\-evacuate \-\-force \-\-pod\-selector="<service=myapp>" |
|
182 |
+ |
|
177 | 183 |
# Show pods that will be migrated |
178 | 184 |
openshift cli adm manage\-node <mynode> \-\-evacuate \-\-dry\-run \-\-pod\-selector="<service=myapp>" |
179 | 185 |
|
... | ... |
@@ -43,7 +43,7 @@ func (e *EvacuateOptions) AddFlags(cmd *cobra.Command) { |
43 | 43 |
|
44 | 44 |
flags.BoolVar(&e.DryRun, flagDryRun, e.DryRun, "Show pods that will be migrated. Optional param for --evacuate") |
45 | 45 |
flags.BoolVar(&e.Force, flagForce, e.Force, "Delete pods not backed by replication controller. Optional param for --evacuate") |
46 |
- flags.Int64Var(&e.GracePeriod, flagGracePeriod, e.GracePeriod, "Grace period (seconds) for pods being deleted. Optional param for --evacuate") |
|
46 |
+ flags.Int64Var(&e.GracePeriod, flagGracePeriod, e.GracePeriod, "Grace period (seconds) for pods being deleted. Ignored if negative. Optional param for --evacuate") |
|
47 | 47 |
|
48 | 48 |
} |
49 | 49 |
|
... | ... |
@@ -102,7 +102,11 @@ func (e *EvacuateOptions) RunEvacuate(node *kapi.Node) error { |
102 | 102 |
errList := []error{} |
103 | 103 |
firstPod := true |
104 | 104 |
numPodsWithNoRC := 0 |
105 |
- deleteOptions := e.makeDeleteOptions() |
|
105 |
+ |
|
106 |
+ var deleteOptions *kapi.DeleteOptions |
|
107 |
+ if e.GracePeriod >= 0 { |
|
108 |
+ deleteOptions = e.makeDeleteOptions() |
|
109 |
+ } |
|
106 | 110 |
|
107 | 111 |
for _, pod := range pods.Items { |
108 | 112 |
foundrc := false |
... | ... |
@@ -36,6 +36,12 @@ list-pods: List all/selected pods on given/selected nodes. It can list the outpu |
36 | 36 |
# Migrate selected pods |
37 | 37 |
%[1]s <mynode> --evacuate --pod-selector="<service=myapp>" |
38 | 38 |
|
39 |
+ # Migrate selected pods, use a grace period of 60 seconds |
|
40 |
+ %[1]s <mynode> --evacuate --grace-period=60 --pod-selector="<service=myapp>" |
|
41 |
+ |
|
42 |
+ # Migrate selected pods not backed by replication controller |
|
43 |
+ %[1]s <mynode> --evacuate --force --pod-selector="<service=myapp>" |
|
44 |
+ |
|
39 | 45 |
# Show pods that will be migrated |
40 | 46 |
%[1]s <mynode> --evacuate --dry-run --pod-selector="<service=myapp>" |
41 | 47 |
|