Skip to content

Commit 5f2ef82

Browse files
authored
Merge pull request #89570 from mburke5678/mco-move-params
OCPBUGS:33455 Configuration in CRI-O is deprecated in favor of the configuration in the KubeletConfig
2 parents 055b6ff + f9a16fb commit 5f2ef82

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

modules/create-a-containerruntimeconfig-crd.adoc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@ To revert the changes implemented by using a `ContainerRuntimeConfig` CR, you mu
1515

1616
You can modify the following settings by using a `ContainerRuntimeConfig` CR:
1717

18-
* **PIDs limit**: Setting the PIDs limit in the `ContainerRuntimeConfig` is expected to be deprecated. If PIDs limits are required, it is recommended to use the `podPidsLimit` field in the `KubeletConfig` CR instead. The default `podPidsLimit` value is `4096` and the default `pids_limit` value is `0`. If `podPidsLimit` is lower than `pids_limit` then the effective container PIDs limit is defined by the value set in `podPidsLimit`.
19-
+
20-
[NOTE]
21-
====
22-
The CRI-O flag is applied on the cgroup of the container, while the Kubelet flag is set on the cgroup of the pod. Please adjust the PIDs limit accordingly.
23-
====
24-
2518
* **Log level**: The `logLevel` parameter sets the CRI-O `log_level` parameter, which is the level of verbosity for log messages. The default is `info` (`log_level = info`). Other options include `fatal`, `panic`, `error`, `warn`, `debug`, and `trace`.
2619
* **Overlay size**: The `overlaySize` parameter sets the CRI-O Overlay storage driver `size` parameter, which is the maximum size of a container image.
27-
* **Maximum log size**: Setting the maximum log size in the `ContainerRuntimeConfig` is expected to be deprecated. If a maximum log size is required, it is recommended to use the `containerLogMaxSize` field in the `KubeletConfig` CR instead.
2820
* **Container runtime**: The `defaultRuntime` parameter sets the container runtime to either `crun` or `runc`. The default is `crun`.
2921
3022
You should have one `ContainerRuntimeConfig` CR for each machine config pool with all the config changes you want for that pool. If you are applying the same content to all the pools, you only need one `ContainerRuntimeConfig` CR for all the pools.

modules/create-a-kubeletconfig-crd-to-edit-kubelet-parameters.adoc

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $ oc get kubeletconfig
5757

5858
[source,terminal]
5959
----
60-
NAME AGE
61-
set-max-pods 15m
60+
NAME AGE
61+
set-kubelet-config 15m
6262
----
6363

6464
.Example showing a `KubeletConfig` machine config
@@ -74,7 +74,7 @@ $ oc get mc | grep kubelet
7474
...
7575
----
7676

77-
The following procedure is an example to show how to configure the maximum number of pods per node on the worker nodes.
77+
The following procedure is an example to show how to configure the maximum number of pods per node, the maximum PIDs per node, and the maximum container log size size on the worker nodes.
7878

7979
.Prerequisites
8080

@@ -104,15 +104,15 @@ metadata:
104104
creationTimestamp: 2019-02-08T14:52:39Z
105105
generation: 1
106106
labels:
107-
custom-kubelet: set-max-pods <1>
107+
custom-kubelet: set-kubelet-config <1>
108108
----
109109
<1> If a label has been added it appears under `labels`.
110110

111111
.. If the label is not present, add a key/value pair:
112112
+
113113
[source,terminal]
114114
----
115-
$ oc label machineconfigpool worker custom-kubelet=set-max-pods
115+
$ oc label machineconfigpool worker custom-kubelet=set-kubelet-config
116116
----
117117

118118
.Procedure
@@ -154,7 +154,9 @@ Allocatable:
154154
pods: 250
155155
----
156156

157-
. Set the maximum pods per node on the worker nodes by creating a custom resource file that contains the kubelet configuration:
157+
. Configure the worker nodes as needed:
158+
159+
.. Create a YAML file similar to the following that contains the kubelet configuration:
158160
+
159161
[IMPORTANT]
160162
====
@@ -166,16 +168,23 @@ Kubelet configurations that target a specific machine config pool also affect an
166168
apiVersion: machineconfiguration.openshift.io/v1
167169
kind: KubeletConfig
168170
metadata:
169-
name: set-max-pods
171+
name: set-kubelet-config
170172
spec:
171173
machineConfigPoolSelector:
172174
matchLabels:
173-
custom-kubelet: set-max-pods <1>
174-
kubeletConfig:
175-
maxPods: 500 <2>
175+
custom-kubelet: set-kubelet-config <1>
176+
kubeletConfig: <2>
177+
podPidsLimit: 8192
178+
containerLogMaxSize: 50Mi
179+
maxPods: 500
176180
----
177181
<1> Enter the label from the machine config pool.
178-
<2> Add the kubelet configuration. In this example, use `maxPods` to set the maximum pods per node.
182+
<2> Add the kubelet configuration. For example:
183+
+
184+
--
185+
* Use `podPidsLimit` to set the maximum number of PIDs in any pod.
186+
* Use `containerLogMaxSize` to set the maximum size of the container log file before it is rotated.
187+
* Use `maxPods` to set the maximum pods per node.
179188
+
180189
[NOTE]
181190
====
@@ -186,22 +195,25 @@ The rate at which the kubelet talks to the API server depends on queries per sec
186195
apiVersion: machineconfiguration.openshift.io/v1
187196
kind: KubeletConfig
188197
metadata:
189-
name: set-max-pods
198+
name: set-kubelet-config
190199
spec:
191200
machineConfigPoolSelector:
192201
matchLabels:
193-
custom-kubelet: set-max-pods
202+
custom-kubelet: set-kubelet-config
194203
kubeletConfig:
195204
maxPods: <pod_count>
196205
kubeAPIBurst: <burst_rate>
197206
kubeAPIQPS: <QPS>
198207
----
199208
====
209+
210+
--
211+
200212
.. Update the machine config pool for workers with the label:
201213
+
202214
[source,terminal]
203215
----
204-
$ oc label machineconfigpool worker custom-kubelet=set-max-pods
216+
$ oc label machineconfigpool worker custom-kubelet=set-kubelet-config
205217
----
206218
207219
.. Create the `KubeletConfig` object:
@@ -211,7 +223,9 @@ $ oc label machineconfigpool worker custom-kubelet=set-max-pods
211223
$ oc create -f change-maxPods-cr.yaml
212224
----
213225
214-
.. Verify that the `KubeletConfig` object is created:
226+
.Verification
227+
228+
. Verify that the `KubeletConfig` object is created:
215229
+
216230
[source,terminal]
217231
----
@@ -221,8 +235,8 @@ $ oc get kubeletconfig
221235
.Example output
222236
[source,terminal]
223237
----
224-
NAME AGE
225-
set-max-pods 15m
238+
NAME AGE
239+
set-kubelet-config 15m
226240
----
227241
+
228242
Depending on the number of worker nodes in the cluster, wait for the worker nodes to be rebooted one by one. For a cluster with 3 worker nodes, this could take about 10 to 15 minutes.
@@ -257,7 +271,7 @@ Allocatable:
257271
+
258272
[source,terminal]
259273
----
260-
$ oc get kubeletconfigs set-max-pods -o yaml
274+
$ oc get kubeletconfigs set-kubelet-config -o yaml
261275
----
262276
+
263277
This should show a status of `True` and `type:Success`, as shown in the following example:
@@ -266,10 +280,12 @@ This should show a status of `True` and `type:Success`, as shown in the followin
266280
----
267281
spec:
268282
kubeletConfig:
283+
containerLogMaxSize: 50Mi
269284
maxPods: 500
285+
podPidsLimit: 8192
270286
machineConfigPoolSelector:
271287
matchLabels:
272-
custom-kubelet: set-max-pods
288+
custom-kubelet: set-kubelet-config
273289
status:
274290
conditions:
275291
- lastTransitionTime: "2021-06-30T17:04:07Z"

0 commit comments

Comments
 (0)