Updated on 2026-04-28 GMT+08:00

Creating an Image Snapshot

Before you run a container, the container image needs to be pulled. However, image pull is time-consuming due to factors such as the network status and container image size. To speed up the container startup, CCI allows you to create snapshots for the required images and then use the snapshots to create pods. In this way, image pull is not required, and the container startup time is significantly reduced. This section describes how to create an image snapshot manually. For details about how image snapshots work, see Image Snapshot Overview.

Creating an Image Snapshot Using YAML

  1. Log in to the CCI 2.0 console.
  2. In the navigation pane, choose Image Acceleration.
  3. Click Create from YAML in the upper right corner.

    In the following example, an image snapshot named my-imagesnapshot will be created.

    apiVersion: cci/v2
    kind: ImageSnapshot
    metadata:
      name: 'my-imagesnapshot'
      labels: cci.io/image-snapshot-architecture: "amd64"    #(New) specifies the CPU architecture.
    spec:
      buildingConfig:
        namespace: test
        eipID: 3cxxxxe0-xxxx-xxxx-xxxx-8xxxxf3xxxx4
      imageSnapshotSize: 30
      ttlDaysAfterCreated: 7
      images:
        - image: 'nginx:latest'
      registries:
        - imagePullSecret: imagepull-secret
          server: xxxxx.myhuaweicloud.com
          plainHTTP: true
    Table 1 Parameter description

    Field

    Type

    Mandatory

    Example Value

    Description

    .metadata.name

    String

    Yes

    my-imagesnapshot

    Image snapshot name.

    .spec.images.image

    String

    Yes

    nginx:latest

    Image used to create an image snapshot. Up to 10 images can be added.

    .spec.registries.server

    String

    Yes

    xxxxx.myhuaweicloud.com

    Image repository address without the http:// or https:// prefix.

    .spec.registries.imagePullSecret

    String

    No

    imagepull-secret

    Secret for accessing the image repository. A maximum of 10 credentials can be added.

    .spec.registries.plainHTTP

    Boolean

    No

    true

    If the self-managed image repository address uses the HTTP protocol, set the value to true, or the image fails to be pulled due to different protocols. The default value is false.

    .spec.registries.insecureSkipVerify

    Boolean

    No

    true

    If the self-managed image repository address uses a self-issued certificate, set the value to true to skip certificate authentication, or the image fails to be pulled due to a certificate authentication failure. The default value is false.

    .spec.buildingConfig.namespace

    String

    Yes

    test

    Namespace. During image snapshot creation, a pod will be created in this namespace.

    .spec.buildingConfig.eipID

    String

    No

    3cxxxxe0-xxxx-xxxx-xxxx-8xxxxf3xxxx4

    EIP used for pulling images over the public network

    .spec.buildingConfig.autoCreateEIP

    Boolean

    No

    true

    Whether to automatically assign an EIP for the pod that is used for creating the image snapshot. If eipId is specified, autoCreateEIP is ignored. If autoCreateEIP is set to true, you need to specify the EIP configuration using autoCreateEIPAttribute.

    .spec.buildingConfig.autoCreateEIPAttribute.bandwidthChargeMode

    String

    No

    bandwidth

    Whether the bandwidth is billed by traffic or bandwidth.

    The value can be traffic or bandwidth. If this parameter is left blank or is an empty string, default value bandwidth is used. For IPv6 addresses, the default parameter value is bandwidth outside China and traffic in China.

    .spec.buildingConfig.autoCreateEIPAttribute.bandwidthSize

    Integer

    No

    1000

    Bandwidth.

    If billing by bandwidth is selected, the value ranges from 1 Mbit/s to 2,000 Mbit/s by default. If billing by traffic is selected, the value ranges from 1 Mbit/s to 300 Mbit/s by default.

    .spec.buildingConfig.autoCreateEIPAttribute.type

    String

    No

    5_bgp

    EIP type.

    The value can be 5_bgp (dynamic BGP), 5_sbgp (static BGP), or 5_youxuanbgp (premium BGP).

    .spec.buildingConfig.autoCreateEIPAttribute.ipVersion

    Integer

    No

    4

    EIP version.

    4 indicates IPv4 EIP. If this parameter is left blank or is an empty string, an IPv4 EIP is assigned by default.

    .spec.buildingConfig.TimeoutMinutes

    Integer

    No

    1440

    Timeout interval for creating a snapshot, in minutes.

    The value is an integer from 30 (30 minutes) to 10080 (one week). The default value is 1440, indicating one day.

    .spec.ttlDaysAfterCreated

    Integer

    No

    7

    Retention period of the image snapshot, in days. Expired image snapshots will be deleted. The default value is 0, indicating that the snapshot never expires.

    When an image snapshot is used by a workload or pod, this image snapshot remains valid from the time when it was used by the workload or pod until the configured retention period ends.

    NOTE:

    After an image snapshot expires, it still occupies the quota. You need to periodically review and delete expired image snapshots.

    .spec.imageSnapshotSize

    Integer

    No

    30

    Image snapshot size, in GiB. The default value is 20.

    In addition to basic parameters, you can add labels to specify the CPU architecture used for creating an image snapshot. For details about the label, see Table 2.

    Table 2 Label description

    Field

    Type

    Mandatory

    Example Value

    Description

    .labels.cci.io/image-snapshot-architecture

    String

    No

    amd64

    CPU architecture of the image. The options are as follows:

    • amd64 (default value)
    NOTE:

    When specifying the architecture, check whether the pod type is available at the site.

    • amd64: x86 general computing pods