2025-06-27 14:34:10 -04:00
// Module included in the following assemblies:
//
// * nodes/nodes/nodes-nodes-managing.adoc
:_mod-docs-content-type: PROCEDURE
[id="nodes-nodes-parallel-container-pulls-configure_{context}"]
= Configuring parallel container image pulls
2025-11-19 09:59:45 +00:00
[role="_abstract"]
You can control the number of images that can be pulled by your workload simultaneously by using a kubelet configuration. You can set a maximum number of images that can be pulled or force workloads to pull images one at a time.
2025-06-27 14:34:10 -04:00
.Prerequisites
* You have a running {product-title} cluster.
* You are logged in to the cluster as a user with administrative privileges.
.Procedure
. Apply a custom label to the machine config pool where you want to configure parallel pulls by running a command similar to the following.
+
[source,terminal]
----
$ oc label machineconfigpool <mcp_name> parallel-pulls=set
----
. Create a custom resource (CR) to configure parallel image pulling.
+
[source,yaml]
----
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
name: parallel-image-pulls
# ...
spec:
machineConfigPoolSelector:
matchLabels:
parallel-pulls: set
kubeletConfig:
2025-11-19 09:59:45 +00:00
serializeImagePulls: false
maxParallelImagePulls: 3
2025-06-27 14:34:10 -04:00
# ...
----
2025-11-19 09:59:45 +00:00
+
where:
+
`serializeImagePulls`:: Set to `false` to enable parallel image pulls. Set to `true` to force serial image pulling. The default is `false`.
`maxParallelImagePulls`:: 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`.
2025-06-27 14:34:10 -04:00
. Create the new machine config by running a command similar to the following:
+
[source,terminal]
----
$ oc create -f <file_name>.yaml
----
.Verification
. Check the machine configs to see that a new one was added by running the following command:
+
[source,terminal]
----
$ oc get MachineConfig
----
+
[source,terminal]
----
NAME GENERATEDBYCONTROLLER IGNITIONVERSION AGE
00-master 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m
00-worker 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m
# ...
99-parallel-generated-kubelet 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 15s <1>
# ...
rendered-parallel-c634a80f644740974ceb40c054c79e50 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 10s <2>
----
2025-11-19 09:59:45 +00:00
+
where:
+
`99-parallel-generated-kubelet`:: The new machine config. In this example, the machine config is for the `parallel` custom machine config pool.
`rendered-parallel-<sha_numnber>`:: The new rendered machine config. In this example, the machine config is for the `parallel` custom machine config pool.
2025-06-27 14:34:10 -04:00
. Check to see that the nodes in the `parallel` machine config pool are being updated by running the following command:
+
[source,terminal]
----
$ oc get machineconfigpool
----
+
[source,terminal]
----
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE
parallel rendered-parallel-3904f0e69130d125b3b5ef0e981b1ce1 False True False 1 0 0 0 65m
master rendered-master-7536834c197384f3734c348c1d957c18 True False False 3 3 3 0 140m
worker rendered-worker-c634a80f644740974ceb40c054c79e50 True False False 2 2 2 0 140m
----
. When the nodes are updated, verify that the parallel pull maximum was configured:
2025-11-19 09:59:45 +00:00
+
2025-06-27 14:34:10 -04:00
.. Open an `oc debug` session to a node by running a command similar to the following:
+
[source,terminal]
----
$ oc debug node/<node_name>
----
2025-11-19 09:59:45 +00:00
+
2025-06-27 14:34:10 -04:00
.. Set `/host` as the root directory within the debug shell by running the following command:
+
[source,terminal]
----
sh-5.1# chroot /host
----
2025-11-19 09:59:45 +00:00
+
2025-06-27 14:34:10 -04:00
.. Examine the `kubelet.conf` file by running the following command:
+
[source,terminal]
----
sh-5.1# cat /etc/kubernetes/kubelet.conf | grep -i maxParallelImagePulls
----
+
[source,terminal]
----
maxParallelImagePulls: 3
----