Skip to content

Commit 4c41d6d

Browse files
authored
Merge pull request #13548 from rphillips/kubeletconfig-docs
add kubeletconfig management for 4.0
2 parents 6f89a7d + 8ef236b commit 4c41d6d

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed

modules/node-management.adoc

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,176 @@ the `machine-config-server` runs in the cluster. It reads the `machine-config`
4646
custom resource definitions (CRDs) and serves the required Ignition configurations
4747
to new nodes when they join the cluster.
4848
////
49+
50+
When you perform node management operations, you will be creating or
51+
modifying a KubeletConfig Custom Resource (CR).
52+
53+
[[machine-configs-and-pools]]
54+
== Machine Configs and Machine Config Pools
55+
Machine Config Pools manage a cluster of nodes and their corresponding
56+
Machine Configs. Machine Configs contain configuration information for a
57+
cluster.
58+
59+
To list all Machine Config Pools that are known:
60+
61+
----
62+
$ oc get machineconfigpools
63+
NAME CONFIG UPDATED UPDATING DEGRADED
64+
master master-1638c1aea398413bb918e76632f20799 False False False
65+
worker worker-2feef4f8288936489a5a832ca8efe953 False False False
66+
----
67+
68+
To list all Machine Configs:
69+
----
70+
$ oc get machineconfig
71+
NAME GENERATEDBYCONTROLLER IGNITIONVERSION CREATED OSIMAGEURL
72+
00-master 3.11.0-572-g649451d6-dirty 2.2.0 16m
73+
00-master-ssh 3.11.0-572-g649451d6-dirty 16m
74+
00-worker 3.11.0-572-g649451d6-dirty 2.2.0 16m
75+
00-worker-ssh 3.11.0-572-g649451d6-dirty 16m
76+
01-master-kubelet 3.11.0-572-g649451d6-dirty 2.2.0 16m
77+
01-worker-kubelet 3.11.0-572-g649451d6-dirty 2.2.0 16m
78+
master-1638c1aea398413bb918e76632f20799 3.11.0-572-g649451d6-dirty 2.2.0 16m
79+
worker-2feef4f8288936489a5a832ca8efe953 3.11.0-572-g649451d6-dirty 2.2.0 16m
80+
----
81+
82+
To list all KubeletConfigs:
83+
84+
----
85+
$ oc get kubeletconfigs
86+
----
87+
88+
To get more detailed information about a KubeletConfig, including the reason for
89+
the current condition:
90+
91+
----
92+
$ oc describe kubeletconfig <name>
93+
----
94+
95+
For example:
96+
97+
----
98+
# oc describe kubeletconfig max-pods
99+
100+
Name: set-max-pods <1>
101+
Namespace:
102+
Labels: <none>
103+
Annotations: <none>
104+
API Version: machineconfiguration.openshift.io/v1
105+
Kind: KubeletConfig
106+
Metadata:
107+
Creation Timestamp: 2019-02-05T16:27:20Z
108+
Generation: 1
109+
Resource Version: 19694
110+
Self Link: /apis/machineconfiguration.openshift.io/v1/kubeletconfigs/set-max-pods
111+
UID: e8ee6410-2962-11e9-9bcc-664f163f5f0f
112+
Spec:
113+
Kubelet Config: <2>
114+
Max Pods: 100
115+
Machine Config Pool Selector: <3>
116+
Match Labels:
117+
Custom - Kubelet: small-pods
118+
Events: <none>
119+
----
120+
121+
<1> The name of the KubeletConfig.
122+
<2> The user defined configuration.
123+
<3> The Machine Config Pool selector to apply the KubeletConfig to.
124+
125+
[[modifying-nodes]]
126+
== Modifying Nodes
127+
128+
{product-title} uses a KubeletConfig Custom Resource to manage the
129+
configuration of nodes. By creating an instance of a KubeletConfig, a managed
130+
MachineConfig is created to override setting on the node.
131+
132+
[NOTE]
133+
====
134+
*Logging into remote machines for the purpose of changing their configuration is not supported.*
135+
====
136+
137+
To make configuration changes to a MachinePool, you need to create a KubeletConfig instance. The Machine Config Controller watches for
138+
KubeletConfigs and applies the configuration.
139+
140+
.Sample configuration for a *max-pods* KubeletConfig
141+
----
142+
apiVersion: machineconfiguration.openshift.io/v1
143+
kind: KubeletConfig
144+
metadata:
145+
name: set-max-pods <1>
146+
spec:
147+
machineConfigPoolSelector:
148+
matchLabels: <2>
149+
custom-kubelet: small-pods
150+
kubeletConfig: <3>
151+
maxPods: 100
152+
----
153+
154+
<1> The name of the KubeletConfig.
155+
<2> The MachineConfigPool selector to apply the KubeletConfig to.
156+
<3> https://github.com/kubernetes/kubernetes/blob/release-1.11/pkg/kubelet/apis/kubeletconfig/v1beta1/types.go#L45[KubeletConfig Options]
157+
158+
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:
159+
160+
* CgroupDriver
161+
* ClusterDNS
162+
* ClusterDomain
163+
* RuntimeRequestTimeout
164+
* StaticPodPath
165+
166+
[[admin-guide-max-pods-per-node]]
167+
=== Setting maximum pods per node
168+
169+
////
170+
The following section is included in the Scaling and Performance Guide.
171+
////
172+
// tag::admin_guide_manage_nodes[]
173+
174+
In the KubeletConfig, two parameters control the maximum number of pods that
175+
can be scheduled to a node: `podsPerCore` and `maxPods`. When both options
176+
are in use, the lower of the two limits the number of pods on a node.
177+
Exceeding these values can result in:
178+
179+
* Increased CPU utilization on both {product-title} and Docker.
180+
* Slow pod scheduling.
181+
* Potential out-of-memory scenarios (depends on the amount of memory in the node).
182+
* Exhausting the pool of IP addresses.
183+
* Resource overcommitting, leading to poor user application performance.
184+
185+
[NOTE]
186+
====
187+
In Kubernetes, a pod that is holding a single container actually uses two
188+
containers. The second container is used to set up networking prior to the
189+
actual container starting. Therefore, a system running 10 pods will actually
190+
have 20 containers running.
191+
====
192+
193+
`podsPerCore` sets the number of pods the node can run based on the number of
194+
processor cores on the node. For example, if `podsPerCore` is set to `10` on
195+
a node with 4 processor cores, the maximum number of pods allowed on the node
196+
will be 40.
197+
198+
----
199+
spec:
200+
kubeletConfig:
201+
podsPerCore: 100
202+
----
203+
204+
[NOTE]
205+
====
206+
Setting `podsPerCore` to 0 disables this limit.
207+
====
208+
209+
`maxPods` sets the number of pods the node can run to a fixed value, regardless
210+
of the properties of the node.
211+
212+
----
213+
spec:
214+
kubeletConfig:
215+
maxPods: 250
216+
----
217+
218+
Using the above example, the default value for `podsPerCore` is `10` and the
219+
default value for `maxPods` is `250`. This means that unless the node has 25
220+
cores or more, by default, `podsPerCore` will be the limiting factor.
221+
// end::admin_guide_manage_nodes[]

0 commit comments

Comments
 (0)