Skip to content

Added oc adm drain options for 3.9 #7881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions admin_guide/manage_nodes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ xref:../architecture/infrastructure_components/kubernetes_infrastructure.adoc#no
== Listing Nodes
To list all nodes that are known to the master:

====
----
$ oc get nodes
NAME STATUS AGE
master.example.com Ready,SchedulingDisabled 165d
node1.example.com Ready 165d
node2.example.com Ready 165d
----
====

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

For example:

====
----
$ oc describe node node1.example.com
Name: node1.example.com
Expand All @@ -104,7 +101,6 @@ Pods: (2 in total)
router-1-maytv
No events.
----
====

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

For example:

====
[options="nowrap"]
----
$ oc adm manage-node node1.example.com --schedulable=false
NAME LABELS STATUS
node1.example.com kubernetes.io/hostname=node1.example.com Ready,SchedulingDisabled
----
====

To mark a currently unschedulable node or nodes as schedulable:

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

To evacuate one or more nodes:
To evacuate all or selected pods on one or more nodes:

----
$ oc adm drain <node1> <node2>
$ oc adm drain <node1> <node2> [--pod-selector=<pod_selector>]
----

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

Instead of specifying specific node names (for example, `<node1> <node2>`), you
can use the `--selector=<node_selector>` option to evacuate pods on selected
nodes.

[[rebooting-nodes]]
== Rebooting Nodes

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

====
----
$ oc edit dc/docker-registry -o yaml

Expand All @@ -370,7 +367,6 @@ $ oc edit dc/docker-registry -o yaml
}
}
----
====

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

====
----
kubeletArguments:
max-pods: <1>
Expand All @@ -434,7 +429,6 @@ resolution configuration.
Default: 90%
<4> The percent of disk usage before which image garbage collection is never run.
Lowest disk usage to garbage collect to. Default: 80%
====

To view all available kubelet options:

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

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

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

====
----
kubeletArguments:
pods-per-core:
- "10"
----
====

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

====
----
kubeletArguments:
max-pods:
- "250"
----
====

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

. Set the `*openshift_set_node_ip*` Ansible variable to `true`.
. Set the `*openshift_ip*` to the IP address for the node you want to configure.

[NOTE]
====
Although `*openshift_set_node_ip*` can be useful as a workaround for the
Expand Down