@@ -27,15 +27,13 @@ xref:../architecture/infrastructure_components/kubernetes_infrastructure.adoc#no
27
27
== Listing Nodes
28
28
To list all nodes that are known to the master:
29
29
30
- ====
31
30
----
32
31
$ oc get nodes
33
32
NAME STATUS AGE
34
33
master.example.com Ready,SchedulingDisabled 165d
35
34
node1.example.com Ready 165d
36
35
node2.example.com Ready 165d
37
36
----
38
- ====
39
37
40
38
To only list information about a single node, replace `<node>` with the full
41
39
node name:
@@ -78,7 +76,6 @@ $ oc describe node <node>
78
76
79
77
For example:
80
78
81
- ====
82
79
----
83
80
$ oc describe node node1.example.com
84
81
Name: node1.example.com
@@ -104,7 +101,6 @@ Pods: (2 in total)
104
101
router-1-maytv
105
102
No events.
106
103
----
107
- ====
108
104
109
105
[[adding-nodes]]
110
106
== Adding Nodes
@@ -208,14 +204,12 @@ $ oc adm manage-node <node1> <node2> --schedulable=false
208
204
209
205
For example:
210
206
211
- ====
212
207
[options="nowrap"]
213
208
----
214
209
$ oc adm manage-node node1.example.com --schedulable=false
215
210
NAME LABELS STATUS
216
211
node1.example.com kubernetes.io/hostname=node1.example.com Ready,SchedulingDisabled
217
212
----
218
- ====
219
213
220
214
To mark a currently unschedulable node or nodes as schedulable:
221
215
@@ -241,10 +235,10 @@ controller] can be evacuated; the replication controllers create new pods on
241
235
other nodes and remove the existing pods from the specified node(s). Bare pods,
242
236
meaning those not backed by a replication controller, are unaffected by default.
243
237
244
- To evacuate one or more nodes:
238
+ To evacuate all or selected pods on one or more nodes:
245
239
246
240
----
247
- $ oc adm drain <node1> <node2>
241
+ $ oc adm drain <node1> <node2> [--pod-selector=<pod_selector>]
248
242
----
249
243
250
244
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`:
292
286
$ oc adm drain <node1> <node2> --dry-run=true
293
287
----
294
288
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
+
295
293
[[rebooting-nodes]]
296
294
== Rebooting Nodes
297
295
@@ -346,7 +344,6 @@ this feature is to set the `*scheduler.alpha.kubernetes.io/affinity*` on the
346
344
pod. Since this pod uses a deployment configuration, the most appropriate
347
345
place to add the annotation is to the pod template's metadata.
348
346
349
- ====
350
347
----
351
348
$ oc edit dc/docker-registry -o yaml
352
349
@@ -370,7 +367,6 @@ $ oc edit dc/docker-registry -o yaml
370
367
}
371
368
}
372
369
----
373
- ====
374
370
375
371
[IMPORTANT]
376
372
====
@@ -414,7 +410,6 @@ You can configure node resources by adding kubelet arguments to the node
414
410
configuration file (*_/etc/origin/node/node-config.yaml_*). Add the
415
411
`*kubeletArguments*` section and include any desired options:
416
412
417
- ====
418
413
----
419
414
kubeletArguments:
420
415
max-pods: <1>
@@ -434,7 +429,6 @@ resolution configuration.
434
429
Default: 90%
435
430
<4> The percent of disk usage before which image garbage collection is never run.
436
431
Lowest disk usage to garbage collect to. Default: 80%
437
- ====
438
432
439
433
To view all available kubelet options:
440
434
@@ -446,11 +440,9 @@ This can also be set during an
446
440
xref:../install_config/install/advanced_install.adoc#configuring-ansible[advanced
447
441
installation] using the `*openshift_node_kubelet_args*` variable. For example:
448
442
449
- ====
450
443
----
451
444
openshift_node_kubelet_args={'max-pods': ['40'], 'resolv-conf': ['/etc/resolv.conf'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}
452
445
----
453
- ====
454
446
455
447
[[admin-guide-max-pods-per-node]]
456
448
=== 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
483
475
a node with 4 processor cores, the maximum number of pods allowed on the node
484
476
will be 40.
485
477
486
- ====
487
478
----
488
479
kubeletArguments:
489
480
pods-per-core:
490
481
- "10"
491
482
----
492
- ====
493
483
494
484
[NOTE]
495
485
====
@@ -499,13 +489,11 @@ Setting `pods-per-core` to 0 disables this limit.
499
489
`max-pods` sets the number of pods the node can run to a fixed value, regardless
500
490
of the properties of the node.
501
491
502
- ====
503
492
----
504
493
kubeletArguments:
505
494
max-pods:
506
495
- "250"
507
496
----
508
- ====
509
497
510
498
Using the above example, the default value for `pods-per-core` is `10` and the
511
499
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:
622
610
623
611
. Set the `*openshift_set_node_ip*` Ansible variable to `true`.
624
612
. Set the `*openshift_ip*` to the IP address for the node you want to configure.
613
+
625
614
[NOTE]
626
615
====
627
616
Although `*openshift_set_node_ip*` can be useful as a workaround for the
0 commit comments