Skip to content

Commit 7ec3458

Browse files
authored
Merge pull request #95384 from mburke5678/mco-add-maxParallelImagePulls
OCPBUGS50970 Configuring maxParallelImagePulls value using KubeletConfig in RHOCP 4
2 parents 0108494 + 65605d6 commit 7ec3458

File tree

3 files changed

+152
-0
lines changed

3 files changed

+152
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes/nodes-nodes-managing.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="nodes-nodes-parallel-container-pulls-about_{context}"]
7+
= About configuring parallel container image pulls
8+
9+
To help control bandwidth issues, you can configure the number of workload images that can be pulled at the same time.
10+
11+
By default, the cluster pulls images in parallel, which allows multiple workloads to pull images at the same time. Pulling multiple images in parallel can improve workload start-up time because workloads can pull needed images without waiting for each other. However, pulling too many images at the same time can use excessive network bandwidth and cause latency issues throughout your cluster.
12+
13+
The default setting allows unlimited simultaneous image pulls. But, you can configure the maximum number of images that can be pulled in parallel. You can also force serial image pulling, which means that only one image can be pulled at a time.
14+
15+
To control the number of images that can be pulled simultaneously, use a kubelet configuration to set the `maxParallelImagePulls` to specify a limit. Additional image pulls above this limit are held until one of the current pulls is complete.
16+
17+
To force serial image pulls, use a kubelet configuration to set `serializeImagePulls` field to `true`.
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * nodes/nodes/nodes-nodes-managing.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="nodes-nodes-parallel-container-pulls-configure_{context}"]
7+
= Configuring parallel container image pulls
8+
9+
You can control the number of images that can be pulled by your workload simultaneously by using a kubelet configuration.
10+
11+
You can set a maximum number of images that can be pulled or force workloads to pull images one at a time.
12+
13+
.Prerequisites
14+
15+
* You have a running {product-title} cluster.
16+
17+
* You are logged in to the cluster as a user with administrative privileges.
18+
19+
.Procedure
20+
21+
. Apply a custom label to the machine config pool where you want to configure parallel pulls by running a command similar to the following.
22+
+
23+
[source,terminal]
24+
----
25+
$ oc label machineconfigpool <mcp_name> parallel-pulls=set
26+
----
27+
28+
. Create a custom resource (CR) to configure parallel image pulling.
29+
+
30+
[source,yaml]
31+
----
32+
apiVersion: machineconfiguration.openshift.io/v1
33+
kind: KubeletConfig
34+
metadata:
35+
name: parallel-image-pulls
36+
# ...
37+
spec:
38+
machineConfigPoolSelector:
39+
matchLabels:
40+
parallel-pulls: set
41+
kubeletConfig:
42+
serializeImagePulls: false <1>
43+
maxParallelImagePulls: 3 <2>
44+
# ...
45+
----
46+
<1> Set to `false` to enable parallel image pulls. Set to `true` to force serial image pulling. The default is `false`.
47+
<2> Specify the maximum number of images that can be pulled in parallel. Enter a number or set to `nil` to specify no limit. This field cannot be set if `SerializeImagePulls` is `true`. The default is `nil`.
48+
49+
. Create the new machine config by running a command similar to the following:
50+
+
51+
[source,terminal]
52+
----
53+
$ oc create -f <file_name>.yaml
54+
----
55+
56+
.Verification
57+
58+
. Check the machine configs to see that a new one was added by running the following command:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc get MachineConfig
63+
----
64+
+
65+
.Example output
66+
+
67+
[source,terminal]
68+
----
69+
NAME GENERATEDBYCONTROLLER IGNITIONVERSION AGE
70+
00-master 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m
71+
00-worker 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m
72+
# ...
73+
99-parallel-generated-kubelet 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 15s <1>
74+
# ...
75+
rendered-parallel-c634a80f644740974ceb40c054c79e50 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 10s <2>
76+
----
77+
<1> The new machine config. In this example, the machine config is for the `parallel` custom machine config pool.
78+
<2> The new rendered machine config. In this example, the machine config is for the `parallel` custom machine config pool.
79+
80+
. Check to see that the nodes in the `parallel` machine config pool are being updated by running the following command:
81+
+
82+
[source,terminal]
83+
----
84+
$ oc get machineconfigpool
85+
----
86+
+
87+
.Example output
88+
+
89+
[source,terminal]
90+
----
91+
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
92+
parallel rendered-parallel-3904f0e69130d125b3b5ef0e981b1ce1 False True False 1 0 0 0 65m
93+
master rendered-master-7536834c197384f3734c348c1d957c18 True False False 3 3 3 0 140m
94+
worker rendered-worker-c634a80f644740974ceb40c054c79e50 True False False 2 2 2 0 140m
95+
----
96+
97+
. When the nodes are updated, verify that the parallel pull maximum was configured:
98+
99+
.. Open an `oc debug` session to a node by running a command similar to the following:
100+
+
101+
[source,terminal]
102+
----
103+
$ oc debug node/<node_name>
104+
----
105+
106+
.. Set `/host` as the root directory within the debug shell by running the following command:
107+
+
108+
[source,terminal]
109+
----
110+
sh-5.1# chroot /host
111+
----
112+
113+
.. Examine the `kubelet.conf` file by running the following command:
114+
+
115+
[source,terminal]
116+
----
117+
sh-5.1# cat /etc/kubernetes/kubelet.conf | grep -i maxParallelImagePulls
118+
----
119+
+
120+
.Example output
121+
+
122+
[source,terminal]
123+
----
124+
maxParallelImagePulls: 3
125+
----
126+

nodes/nodes/nodes-nodes-managing.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ configuration of nodes. By creating an instance of a `KubeletConfig` object, a m
2424
include::modules/nodes-nodes-managing-about.adoc[leveloffset=+1]
2525

2626
include::modules/nodes-nodes-working-master-schedulable.adoc[leveloffset=+1]
27+
2728
include::modules/nodes-nodes-working-setting-booleans.adoc[leveloffset=+1]
29+
2830
include::modules/nodes-nodes-kernel-arguments.adoc[leveloffset=+1]
31+
2932
ifdef::openshift-webscale[]
3033
include::modules/nodes-nodes-rtkernel-arguments.adoc[leveloffset=+1]
3134
endif::openshift-webscale[]
3235

3336
include::modules/nodes-nodes-swap-memory.adoc[leveloffset=+1]
37+
38+
include::modules/nodes-nodes-parallel-container-pulls-about.adoc[leveloffset=+1]
39+
40+
include::modules/nodes-nodes-parallel-container-pulls-configure.adoc[leveloffset=+2]
41+
3442
include::modules/nodes-control-plane-osp-migrating.adoc[leveloffset=+1]
43+
3544
[role="_additional-resources"]
3645
.Additional resources
3746

0 commit comments

Comments
 (0)