|
1 | 1 | --- |
2 | 2 | title: Can't pull images from Azure Container Registry to Kubernetes |
3 | 3 | description: This article helps you troubleshoot the most common errors that you may encounter when pulling images from a container registry to an AKS cluster. |
4 | | -ms.date: 03/25/2025 |
| 4 | +ms.date: 06/05/2025 |
5 | 5 | author: genlin |
6 | 6 | ms.author: genli |
7 | | -ms.reviewer: chiragpa, andbar, v-weizhu, v-leedennis |
| 7 | +ms.reviewer: chiragpa, andbar, albarqaw, v-weizhu, v-leedennis |
8 | 8 | ms.service: azure-kubernetes-service |
9 | 9 | ms.custom: sap:Extensions, Policies and Add-Ons, devx-track-azurecli |
10 | 10 | --- |
@@ -349,6 +349,40 @@ spec: |
349 | 349 | nodeSelector: |
350 | 350 | "kubernetes.io/os": linux |
351 | 351 | ``` |
| 352 | +## Cause 6: Kubelet exceeds the default image pull rate limit |
| 353 | + |
| 354 | +When multiple jobs pull the same images, the Kubelet default pull rate limit might be exceeded. In this case, an error message like the following one is displayed: |
| 355 | + |
| 356 | +> Failed to pull image "acrname.azurecr.io/repo/nginx:latest": **pull QPS exceeded**. This occurred for pod \<podname\> at 4/22/2025, 12:48:32.000 PM UTC. |
| 357 | +
|
| 358 | +For more information about the limit, see the [registryPullQPS configuration](https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration). |
| 359 | + |
| 360 | +### Solution: Change the value of imagePullPolicy to IfNotPresent |
| 361 | + |
| 362 | +To resolve this issue, change the value of [imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) from `Always` to `IfNotPresent` in the deployment YAML file to prevent unnecessary pulls. `IfNotPresent` ensures that the image is pulled from the registry only if it's not already present on the node. |
| 363 | + |
| 364 | +Here's an example of the deployment YAML file: |
| 365 | + |
| 366 | +```yaml |
| 367 | +apiVersion: apps/v1 |
| 368 | +kind: Deployment |
| 369 | +metadata: |
| 370 | + name: my-deployment |
| 371 | +spec: |
| 372 | + replicas: 3 |
| 373 | + selector: |
| 374 | + matchLabels: |
| 375 | + app: my-app |
| 376 | + template: |
| 377 | + metadata: |
| 378 | + labels: |
| 379 | + app: my-app |
| 380 | + spec: |
| 381 | + containers: |
| 382 | + - name: my-container |
| 383 | + image: myacr.azurecr.io/my-image:latest |
| 384 | + imagePullPolicy: IfNotPresent |
| 385 | +``` |
352 | 386 |
|
353 | 387 | ## More information |
354 | 388 |
|
|
0 commit comments