Skip to content

Commit 33265c6

Browse files
authored
Merge pull request #7881 from ahardin-rh/oc-adm-drain-39
Added oc adm drain options for 3.9
2 parents db225fd + ce14a8a commit 33265c6

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

admin_guide/manage_nodes.adoc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ xref:../architecture/infrastructure_components/kubernetes_infrastructure.adoc#no
2727
== Listing Nodes
2828
To list all nodes that are known to the master:
2929

30-
====
3130
----
3231
$ oc get nodes
3332
NAME STATUS AGE
3433
master.example.com Ready,SchedulingDisabled 165d
3534
node1.example.com Ready 165d
3635
node2.example.com Ready 165d
3736
----
38-
====
3937

4038
To only list information about a single node, replace `<node>` with the full
4139
node name:
@@ -78,7 +76,6 @@ $ oc describe node <node>
7876

7977
For example:
8078

81-
====
8279
----
8380
$ oc describe node node1.example.com
8481
Name: node1.example.com
@@ -104,7 +101,6 @@ Pods: (2 in total)
104101
router-1-maytv
105102
No events.
106103
----
107-
====
108104

109105
[[adding-nodes]]
110106
== Adding Nodes
@@ -208,14 +204,12 @@ $ oc adm manage-node <node1> <node2> --schedulable=false
208204

209205
For example:
210206

211-
====
212207
[options="nowrap"]
213208
----
214209
$ oc adm manage-node node1.example.com --schedulable=false
215210
NAME LABELS STATUS
216211
node1.example.com kubernetes.io/hostname=node1.example.com Ready,SchedulingDisabled
217212
----
218-
====
219213

220214
To mark a currently unschedulable node or nodes as schedulable:
221215

@@ -241,10 +235,10 @@ controller] can be evacuated; the replication controllers create new pods on
241235
other nodes and remove the existing pods from the specified node(s). Bare pods,
242236
meaning those not backed by a replication controller, are unaffected by default.
243237

244-
To evacuate one or more nodes:
238+
To evacuate all or selected pods on one or more nodes:
245239

246240
----
247-
$ oc adm drain <node1> <node2>
241+
$ oc adm drain <node1> <node2> [--pod-selector=<pod_selector>]
248242
----
249243

250244
You can force deletion of bare pods by using the `--force` option. When set to
@@ -292,6 +286,10 @@ use the `--dry-run` option and set it to `true`:
292286
$ oc adm drain <node1> <node2> --dry-run=true
293287
----
294288

289+
Instead of specifying specific node names (for example, `<node1> <node2>`), you
290+
can use the `--selector=<node_selector>` option to evacuate pods on selected
291+
nodes.
292+
295293
[[rebooting-nodes]]
296294
== Rebooting Nodes
297295

@@ -346,7 +344,6 @@ this feature is to set the `*scheduler.alpha.kubernetes.io/affinity*` on the
346344
pod. Since this pod uses a deployment configuration, the most appropriate
347345
place to add the annotation is to the pod template's metadata.
348346

349-
====
350347
----
351348
$ oc edit dc/docker-registry -o yaml
352349
@@ -370,7 +367,6 @@ $ oc edit dc/docker-registry -o yaml
370367
}
371368
}
372369
----
373-
====
374370

375371
[IMPORTANT]
376372
====
@@ -414,7 +410,6 @@ You can configure node resources by adding kubelet arguments to the node
414410
configuration file (*_/etc/origin/node/node-config.yaml_*). Add the
415411
`*kubeletArguments*` section and include any desired options:
416412

417-
====
418413
----
419414
kubeletArguments:
420415
max-pods: <1>
@@ -434,7 +429,6 @@ resolution configuration.
434429
Default: 90%
435430
<4> The percent of disk usage before which image garbage collection is never run.
436431
Lowest disk usage to garbage collect to. Default: 80%
437-
====
438432

439433
To view all available kubelet options:
440434

@@ -446,11 +440,9 @@ This can also be set during an
446440
xref:../install_config/install/advanced_install.adoc#configuring-ansible[advanced
447441
installation] using the `*openshift_node_kubelet_args*` variable. For example:
448442

449-
====
450443
----
451444
openshift_node_kubelet_args={'max-pods': ['40'], 'resolv-conf': ['/etc/resolv.conf'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}
452445
----
453-
====
454446

455447
[[admin-guide-max-pods-per-node]]
456448
=== Setting Maximum Pods Per Node
@@ -483,13 +475,11 @@ processor cores on the node. For example, if `pods-per-core` is set to `10` on
483475
a node with 4 processor cores, the maximum number of pods allowed on the node
484476
will be 40.
485477

486-
====
487478
----
488479
kubeletArguments:
489480
pods-per-core:
490481
- "10"
491482
----
492-
====
493483

494484
[NOTE]
495485
====
@@ -499,13 +489,11 @@ Setting `pods-per-core` to 0 disables this limit.
499489
`max-pods` sets the number of pods the node can run to a fixed value, regardless
500490
of the properties of the node.
501491

502-
====
503492
----
504493
kubeletArguments:
505494
max-pods:
506495
- "250"
507496
----
508-
====
509497

510498
Using the above example, the default value for `pods-per-core` is `10` and the
511499
default value for `max-pods` is `250`. This means that unless the node has 25
@@ -622,6 +610,7 @@ To change the node traffic interface:
622610

623611
. Set the `*openshift_set_node_ip*` Ansible variable to `true`.
624612
. Set the `*openshift_ip*` to the IP address for the node you want to configure.
613+
625614
[NOTE]
626615
====
627616
Although `*openshift_set_node_ip*` can be useful as a workaround for the

0 commit comments

Comments
 (0)