Skip to content

Commit 7dc5726

Browse files
authored
Merge pull request #13576 from mburke5678/nodes-modify-nodes
Added information on managing nodes from rphillips
2 parents b32c6ab + 47d7af5 commit 7dc5726

7 files changed

+252
-5
lines changed

_topic_map.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,23 @@ Topics:
307307
File: nodes-scheduler-node-selectors
308308
- Name: Keeping your cluster balanced using the descheduler
309309
File: nodes-scheduler-descheduler
310+
- Name: Managing Nodes
311+
Dir: managing
312+
Topics:
313+
- Name: Managing Nodes
314+
File: nodes-nodes-managing
315+
- Name: Managing the maximum number of Pods per Node
316+
File: nodes-nodes-managing-max-pods
317+
- Name: Freeing node resources using garbage collection
318+
File: nodes-nodes-garbage-collection
319+
- Name: Allocating resources for nodes
320+
File: nodes-nodes-resources-configuring
310321
- Name: Viewing and listing the nodes in your cluster
311322
File: nodes-nodes-viewing
312323
- Name: Working with nodes
313324
File: nodes-nodes-working
314325
- Name: Understanding node rebooting
315326
File: nodes-nodes-rebooting
316-
- Name: Freeing node resources using garbage collection
317-
File: nodes-nodes-garbage-collection
318-
- Name: Allocating resources for nodes
319-
File: nodes-nodes-resources-configuring
320327
- Name: Advertising hidden resources for nodes
321328
File: nodes-nodes-opaque-resources
322329
- Name: Monitoring for problems in your nodes
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes-nodes-managing.adoc
4+
5+
[id='nodes-nodes-managing-about_{context}']
6+
= Modifying Nodes
7+
8+
To make configuration changes to a cluster, or MachinePool, you need to create a Custom Resource Definition, or KubeletConfig instance. {product-title} uses the Machine Config Controller to watch for changes introduced through the CRD applies the changes to the cluster.
9+
10+
.Procedure
11+
12+
. Obtain the label associated with the static CRD, Machine Config Pool, for the type of node you want to configure.
13+
Perform one of the following steps:
14+
15+
.. Edit the machineconfigpool master, add label"custom-kubelet: small-pods"
16+
+
17+
For example:
18+
+
19+
----
20+
# oc edit machineconfigpool worker
21+
22+
metadata:
23+
creationTimestamp: 2019-01-31T07:10:04Z
24+
generation: 3
25+
labels:
26+
custom-kubelet: small-pods <1>
27+
operator.machineconfiguration.openshift.io/required-for-upgrade: ""
28+
----
29+
<1> If a label has been added it appears under `labels`.
30+
31+
.. If the label is not present, add a key/value pair under `labels`.
32+
33+
. Create a CRD for your configuration change.
34+
+
35+
For example:
36+
+
37+
.Sample configuration for a *max-pods* KubeletConfig
38+
----
39+
apiVersion: machineconfiguration.openshift.io/v1
40+
kind: KubeletConfig
41+
metadata:
42+
name: set-max-pods <1>
43+
spec:
44+
machineConfigPoolSelector:
45+
matchLabels:
46+
custom-kubelet: small-pods <2>
47+
kubeletConfig: <3>
48+
maxPods: 100
49+
----
50+
<1> Assign a name to CRD.
51+
<2> Specify the label to apply the configuration change.
52+
<3> Specify the new value(s) you want to change.
53+
54+
. Create the CRD object.
55+
+
56+
----
57+
$ oc create -f <file-name>
58+
----
59+
+
60+
For example:
61+
+
62+
----
63+
# oc create -f master-kube-config.yaml
64+
----
65+
66+
Most https://github.com/kubernetes/kubernetes/blob/release-1.11/pkg/kubelet/apis/kubeletconfig/v1beta1/types.go#L45[KubeletConfig Options] may be set by the user. The following options are not allowed to be overwritten:
67+
68+
* CgroupDriver
69+
* ClusterDNS
70+
* ClusterDomain
71+
* RuntimeRequestTimeout
72+
* StaticPodPath
73+
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes-nodes-managing-max-pods.adoc
4+
5+
[id='nodes-nodes-managing-max-pods-about_{context}']
6+
= Configuring the maximum number of Pods per Node
7+
8+
////
9+
The following section is included in the Scaling and Performance Guide.
10+
////
11+
12+
Two parameters control the maximum number of pods that can be scheduled to a node: `podsPerCore` and `maxPods`. If you use both options,
13+
the lower of the two limits the number of pods on a node.
14+
15+
For example, if `podsPerCore` is set to `10` on a node with 4 processor cores, the maximum number of pods allowed on the node will be 40.
16+
17+
.Prerequisite
18+
19+
. Obtain the label associated with the static Machine Config Pool CRD for the type of node you want to configure.
20+
Perform one of the following steps:
21+
22+
.. View the Machine Config Pool:
23+
+
24+
----
25+
# oc describe machineconfigpool <name>
26+
----
27+
+
28+
For example:
29+
+
30+
----
31+
# oc describe machineconfigpool worker
32+
33+
apiVersion: machineconfiguration.openshift.io/v1
34+
kind: MachineConfigPool
35+
metadata:
36+
creationTimestamp: 2019-02-08T14:52:39Z
37+
generation: 1
38+
labels:
39+
custom-kubelet: small-pods <1>
40+
----
41+
<1> If a label has been added it appears under `labels`.
42+
43+
.. If the label is not present, add a key/value pair:
44+
+
45+
----
46+
oc label machineconfigpool worker custom-kubelet=small-pods
47+
----
48+
49+
.Procedure
50+
51+
. Create a CRD for your configuration change.
52+
+
53+
.Sample configuration for a *max-pods* CRD
54+
----
55+
apiVersion: machineconfiguration.openshift.io/v1
56+
kind: KubeletConfig
57+
metadata:
58+
name: set-max-pods <1>
59+
spec:
60+
machineConfigPoolSelector:
61+
matchLabels:
62+
custom-kubelet: small-pods <2>
63+
kubeletConfig:
64+
podsPerCore: 100 <3>
65+
maxPods: 250 <4>
66+
----
67+
<1> Assign a name to CRD.
68+
<2> Specify the label to apply the configuration change.
69+
<3> Specify the number of pods the node can run based on the number of
70+
processor cores on the node.
71+
<4> Specify the number of pods the node can run to a fixed value, regardless
72+
of the properties of the node.
73+
+
74+
[NOTE]
75+
====
76+
Setting `podsPerCore` to 0 disables this limit.
77+
====
78+
+
79+
In the above example, the default value for `podsPerCore` is `10` and the
80+
default value for `maxPods` is `250`. This means that unless the node has 25
81+
cores or more, by default, `podsPerCore` will be the limiting factor.
82+
83+
. List the Machine Config Pool CRDs to see if the change is applied. The `UPDATING` column reports `True` if the change is picked up by the Machine Config Controller:
84+
+
85+
----
86+
oc get machineconfigpools
87+
NAME CONFIG UPDATED UPDATING DEGRADED
88+
master master-9cc2c72f205e103bb534 False False False
89+
worker worker-8cecd1236b33ee3f8a5e False True False
90+
----
91+
+
92+
Once the change is complete, the `UPDATED` column reports `True`.
93+
+
94+
----
95+
oc get machineconfigpools
96+
NAME CONFIG UPDATED UPDATING DEGRADED
97+
master master-9cc2c72f205e103bb534 False True False
98+
worker worker-8cecd1236b33ee3f8a5e True False False
99+
----
100+

nodes/nodes-nodes-garbage-collection.adoc renamed to nodes/managing/nodes-nodes-garbage-collection.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
:context: nodes-nodes-configuring
3-
[id='nodes-nodes-garbage-collection_{context}']
3+
[id='nodes-nodes-garbage-collection']
44
= Freeing node resources using garbage collection
55
include::modules/common-attributes.adoc[]
66

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
:context: nodes-nodes-jobs
2+
[id='nodes-nodes-managing-max-pods_{context}']
3+
= Managing the maximum number of Pods per Node
4+
include::modules/common-attributes.adoc[]
5+
6+
toc::[]
7+
8+
9+
In {product-title}, you can configure the number of pods that can run on a node based on the number of
10+
processor cores on the node, a hard limit or both. If you use both options,
11+
the lower of the two limits the number of pods on a node.
12+
13+
Exceeding these values can result in:
14+
15+
* Increased CPU utilization by {product-title}.
16+
* Slow pod scheduling.
17+
* Potential out-of-memory scenarios, depending on the amount of memory in the node.
18+
* Exhausting the IP address pool.
19+
* Resource overcommitting, leading to poor user application performance.
20+
21+
[NOTE]
22+
====
23+
A pod that is holding a single container actually uses two
24+
containers. The second container sets up networking prior to the
25+
actual container starting. As a result, a node running 10 pods actually
26+
has 20 containers running.
27+
====
28+
29+
The `podsPerCore` parameter limits the number of pods the node can run based on the number of
30+
processor cores on the node. For example, if `podsPerCore` is set to `10` on
31+
a node with 4 processor cores, the maximum number of pods allowed on the node is 40.
32+
33+
The `maxPods` parameter limits the number of pods the node can run to a fixed value, regardless
34+
of the properties of the node.
35+
36+
// The following include statements pull in the module files that comprise
37+
// the assembly. Include any combination of concept, procedure, or reference
38+
// modules required to cover the user story. You can also include other
39+
// assemblies.
40+
41+
include::modules/nodes-nodes-managing-max-pods-proc.adoc[leveloffset=+1]
42+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
:context: nodes-nodes-jobs
3+
[id='nodes-nodes-managing_{context}']
4+
= Managing Nodes
5+
include::modules/common-attributes.adoc[]
6+
7+
toc::[]
8+
9+
10+
{product-title} uses a KubeletConfig Custom Resource to manage the
11+
configuration of nodes. By creating an instance of a KubeletConfig, a managed
12+
MachineConfig is created to override setting on the node.
13+
14+
[NOTE]
15+
====
16+
*Logging into remote machines for the purpose of changing their configuration is not supported.*
17+
====
18+
19+
// The following include statements pull in the module files that comprise
20+
// the assembly. Include any combination of concept, procedure, or reference
21+
// modules required to cover the user story. You can also include other
22+
// assemblies.
23+
24+
include::modules/nodes-nodes-managing-about.adoc[leveloffset=+1]
25+

0 commit comments

Comments
 (0)