Help Center> Cloud Container Instance (CCI)> FAQ> Workload Abnormalities> What Do I Do If an Event Indicating That the Image Failed to Be Pulled Occurs?

What Do I Do If an Event Indicating That the Image Failed to Be Pulled Occurs?

If the details page of a workload shows an event indicating that the image fails to be pulled, perform the following operations to locate the fault:

Check Item 1: imagePullSecret (This Is Required When You Use kubectl to Create a Workload)

In the following example, a Deployment named nginx is created. Check whether the .yaml file contains the imagePullSecrets field (bold field in the following information), which indicates the name of the secret used for pulling the image.

To pull an image from the SoftWare Repository for Container (SWR), set this field to imagepull-secret.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx:alpine
        imagePullPolicy: Always
        name: nginx
      imagePullSecrets:
      - name: imagepull-secret

Check Item 2: Image Address

CCI allows you to create workloads using images pulled from SWR.

SWR images can be obtained by using Template Address. After an image is pushed, you can obtain its address.

Figure 1 Template address

Check Item 2: IAM Users' Permissions to Download Images

If you have enabled the Enterprise Management service, you need to use your account to grant IAM users with permissions to access SWR so that the IAM users can download private images of the account.

You can grant permissions to IAM users in either of the following ways: