All Products
Search
Document Center

Elastic Container Instance:Kubernetes ImageCache API

Last Updated:Aug 31, 2026

Manage image caches for Elastic Container Instance (ECI) using the Kubernetes-style ImageCache custom resource.

Data types

ImageCacheList

Parameter Type Description
apiVersion String The API group and version. Set to eci.alibabacloud.com/v1.
kind String The resource type. Set to ImageCacheList.
metadata ListMeta The standard list metadata.
items ImageCache[] The image caches returned by the list.

ImageCache

Parameter Type Description
apiVersion String The API group and version. Set to eci.alibabacloud.com/v1.
kind String The resource type. Set to ImageCache.
metadata ObjectMeta The metadata of the object.
spec ImageCacheSpec The desired configuration of the image cache.
status ImageCacheStatus The current state of the image cache.

ImageCacheSpec

Parameter Type Required Description
images String[] Yes The container images to include in the image cache.
imagePullSecrets String[] No The Secrets for pulling images from private registries. Specify each Secret in the namespace:secretName format.
imageCacheSize Int No The size of the image cache, in GB. Valid values: 20–32768. Default value: 20.
retentionDays Int No The number of days to retain the image cache. Valid values: 1–65536. If not set, the image cache does not expire.

ImageCacheStatus

Parameter Type Description
phase String The current lifecycle phase of the image cache.
progress String The creation progress of the image cache.
imageCacheId String The ID of the image cache.
startTime Time The time when the image cache was created.
lastUpdatedTime Time The time when the image cache was last updated.
events Event[] The events generated during image cache creation.
expireDateTime Time The time when the image cache expires. An image cache may expire at one of the following times: the end of the retention period set at creation, or 24 hours after a failed creation.

CreateImageCache

Creates an image cache.

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 the list of image caches.

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.

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****"
  }
}