All Products
Search
Document Center

Elastic Container Instance:kubernetes ImageCache API

Last Updated:Apr 01, 2026

Manage image caches for Elastic Container Instance (ECI) using the Kubernetes-style ImageCache custom resource. Image caches pre-pull container images onto cloud disks, reducing Pod startup time in ECI.

All operations use the API group eci.alibabacloud.com/v1 and are accessible through a kubectl proxy running on port 8001.

Data types

ImageCacheList

ParameterTypeDescription
apiVersionStringThe API group and version. Set to eci.alibabacloud.com/v1.
kindStringThe resource type. Set to ImageCacheList.
metadataListMetaThe standard list metadata.
itemsImageCache[]The image caches returned by the list.

ImageCache

ParameterTypeDescription
apiVersionStringThe API group and version. Set to eci.alibabacloud.com/v1.
kindStringThe resource type. Set to ImageCache.
metadataObjectMetaThe metadata of the object, including name, uid, and timestamps.
specImageCacheSpecThe desired configuration of the image cache.
statusImageCacheStatusThe current state of the image cache. Populated by the system; read-only.

ImageCacheSpec

ParameterTypeRequiredDescription
imagesString[]YesThe container images to include in the image cache.
imagePullSecretsString[]NoThe Secrets for pulling images from private registries. Specify each Secret in the namespace:secretName format.
imageCacheSizeIntNoThe size of the cloud disk used for the image cache, in GB. Valid values: 20–32768. Default value: 20.
retentionDaysIntNoThe number of days to retain the image cache. Valid values: 1–65536. If not set, the image cache does not expire.

ImageCacheStatus

ParameterTypeDescription
phaseStringThe current lifecycle phase of the image cache, such as Ready.
progressStringThe creation progress of the image cache, expressed as a percentage (for example, 100%).
imageCacheIdStringThe ID of the image cache.
startTimeTimeThe time when the image cache started being created.
lastUpdatedTimeTimeThe time when the image cache was last updated.
eventsEvent[]The events generated during image cache creation.
expireDateTimeTimeThe time when the image cache expires. An image cache may expire at one of the following points in time: the end of the retention period set at creation, or 24 hours after a failed creation.

CreateImageCache

Creates an image cache by pulling the specified images onto a cloud disk. Use this operation to pre-cache images before launching Pods, which reduces startup latency.

HTTP request

POST /apis/eci.alibabacloud.com/v1/imagecaches

Request example

curl -X POST -H 'Content-Type: application/yaml' --data '
apiVersion: eci.alibabacloud.com/v1
kind: ImageCache
metadata:
  name: imagecache-secrets-test
spec:
  images:
  - registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0
  imagePullSecrets:
  - default:acr-test
' http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches

Response example

{
  "apiVersion": "eci.alibabacloud.com/v1",
  "kind": "ImageCache",
  "metadata": {
    "creationTimestamp": "2019-10-10T03:50:47Z",
    "generation": 1,
    "name": "imagecache-secrets-test",
    "resourceVersion": "647052328",
    "selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test11",
    "uid": "2506ba37-eb11-11e9-9576-f2ef49bf****"
  },
  "spec": {
    "imagePullSecrets": [
      "default:acr-test"
    ],
    "images": [
      "registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
    ]
  }
}

ListImageCache

Queries all image caches in the current cluster.

HTTP request

GET /apis/eci.alibabacloud.com/v1/imagecaches

Request example

curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches'

Response example

{
  "apiVersion": "eci.alibabacloud.com/v1",
  "kind": "ImageCacheList",
  "metadata": {
    "continue": "",
    "resourceVersion": "647062964",
    "selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches"
  },
  "items": [
    {
      "apiVersion": "eci.alibabacloud.com/v1",
      "kind": "ImageCache",
      "metadata": {
        "annotations": {
          "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"eci.alibabacloud.com/v1\",\"kind\":\"ImageCache\",\"metadata\":{\"annotations\":{},\"name\":\"imagecache-secrets-test\"},\"spec\":{\"imagePullSecrets\":[\"default:acr-test\"],\"images\":[\"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0\"]}}\n"
        },
        "creationTimestamp": "2019-10-10T01:43:48Z",
        "generation": 1,
        "name": "imagecache-secrets-test",
        "resourceVersion": "646375979",
        "selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test",
        "uid": "67460461-eaff-11e9-9774-b2c06862****"
      },
      "spec": {
        "imagePullSecrets": [
          "default:acr-test"
        ],
        "images": [
          "registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
        ]
      },
      "status": {
        "imageCacheId": "imc-2ze5xnx4yiply807****",
        "lastUpdatedTime": "2019-10-10T01:47:14Z",
        "phase": "Ready",
        "progress": "100%",
        "startTime": "2019-10-10T01:43:49Z"
      }
    }
  ]
}

GetImageCache

Queries the details of a single image cache by name, including its current phase, creation progress, and expiration time.

HTTP request

GET /apis/eci.alibabacloud.com/v1/imagecaches/{name}

Request example

curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test'

Response example

{
  "apiVersion": "eci.alibabacloud.com/v1",
  "kind": "ImageCache",
  "metadata": {
    "annotations": {
      "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"eci.alibabacloud.com/v1\",\"kind\":\"ImageCache\",\"metadata\":{\"annotations\":{},\"name\":\"imagecache-secrets-test\"},\"spec\":{\"imagePullSecrets\":[\"default:acr-test\"],\"images\":[\"registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0\"]}}\n"
    },
    "creationTimestamp": "2019-10-10T01:43:48Z",
    "generation": 1,
    "name": "imagecache-secrets-test",
    "resourceVersion": "646375979",
    "selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test",
    "uid": "67460461-eaff-11e9-9774-b2c06862****"
  },
  "spec": {
    "imagePullSecrets": [
      "default:acr-test"
    ],
    "images": [
      "registry.cn-shanghai.aliyuncs.com/baz/nginx:1.0"
    ]
  },
  "status": {
    "imageCacheId": "imc-2ze5xnx4yiply807****",
    "lastUpdatedTime": "2019-10-10T01:47:14Z",
    "phase": "Ready",
    "progress": "100%",
    "startTime": "2019-10-10T01:43:49Z"
  }
}

DeleteImageCache

Deletes an image cache by name.

HTTP request

DELETE /apis/eci.alibabacloud.com/v1/imagecaches/{name}

Request example

curl -X DELETE -H 'Content-Type: application/yaml' 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test'

Response example

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Success",
  "details": {
    "name": "imagecache-secrets-test",
    "group": "eci.alibabacloud.com",
    "kind": "imagecaches",
    "uid": "67460461-eaff-11e9-9774-b2c06862****"
  }
}