Skip to content

Commit 6a77308

Browse files
authored
Merge pull request #39732 from ruiwen-zhao/parallel
Document update for MaxParallelImagePulls
2 parents f0c2c17 + ee72c54 commit 6a77308

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

content/en/docs/concepts/containers/images.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,48 @@ that Kubernetes will keep trying to pull the image, with an increasing back-off
157157
Kubernetes raises the delay between each attempt until it reaches a compiled-in limit,
158158
which is 300 seconds (5 minutes).
159159

160+
## Serial and parallel image pulls
161+
162+
By default, kubelet pulls images serially. In other words, kubelet sends only
163+
one image pull request to the image service at a time. Other image pull requests
164+
have to wait until the one being processed is complete.
165+
166+
Nodes make image pull decisions in isolation. Even when you use serialized image
167+
pulls, two different nodes can pull the same image in parallel.
168+
169+
If you would like to enable parallel image pulls, you can set the field
170+
`serializeImagePulls` to false in the [kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
171+
With `serializeImagePulls` set to false, image pull requests will be sent to the image service immediately,
172+
and multiple images will be pulled at the same time.
173+
174+
When enabling parallel image pulls, please make sure the image service of your
175+
container runtime can handle parallel image pulls.
176+
177+
The kubelet never pulls multiple images in parallel on behalf of one Pod. For example,
178+
if you have a Pod that has an init container and an application container, the image
179+
pulls for the two containers will not be parallelized. However, if you have two
180+
Pods that use different images, the kubelet pulls the images in parallel on
181+
behalf of the two different Pods, when parallel image pulls is enabled.
182+
183+
### Maximum parallel image pulls
184+
185+
{{< feature-state for_k8s_version="v1.27" state="alpha" >}}
186+
187+
When `serializeImagePulls` is set to false, the kubelet defaults to no limit on the
188+
maximum number of images being pulled at the same time. If you would like to
189+
limit the number of parallel image pulls, you can set the field `maxParallelImagePulls`
190+
in kubelet configuration. With `maxParallelImagePulls` set to _n_, only _n_ images
191+
can be pulled at the same time, and any image pull beyond _n_ will have to wait
192+
until at least one ongoing image pull is complete.
193+
194+
Limiting the number parallel image pulls would prevent image pulling from consuming
195+
too much network bandwidth or disk I/O, when parallel image pulling is enabled.
196+
197+
You can set `maxParallelImagePulls` to a positive number that is greater than or
198+
equal to 1. If you set `maxParallelImagePulls` to be greater than or equal to 2, you
199+
must set the `serializeImagePulls` to false. The kubelet will fail to start with invalid
200+
`maxParallelImagePulls` settings.
201+
160202
## Multi-architecture images with image indexes
161203

162204
As well as providing binary images, a container registry can also serve a

0 commit comments

Comments
 (0)