On this page

Show all

Help Center/ Cloud Container Engine/ FAQs/ Workload/ Others/ What Is the Image Pull Policy for Containers in a CCE Cluster?

What Is the Image Pull Policy for Containers in a CCE Cluster?

Updated on 2024-11-11 GMT+08:00

A container image is required to create a container. Images may be stored locally or in a remote image repository.

The imagePullPolicy field in the Kubernetes configuration file is used to describe the image pull policy. This field has the following value options:

  • Always: Always force a pull.
    imagePullPolicy: Always
  • IfNotPresent: The image is pulled only if it is not already present locally.
    imagePullPolicy: IfNotPresent
  • Never: The image is assumed to exist locally. No attempt is made to pull the image.
    imagePullPolicy: Never

Description

  1. If this field is set to Always, the image is pulled from the remote repository each time a container is started or restarted.

    If imagePullPolicy is left blank, the policy defaults to Always.

  2. If the policy is set to IfNotPreset:
    1. When the required image does not exist locally, it will be pulled from the remote repository.
    2. When the content, except the tag, of the required image is the same as that of the local image, and the image with that tag exists only in the remote repository, Kubernetes will not pull the image from the remote repository.
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback