This topic describes Kubernetes ImageCache APIs.
Data types
ImageCacheList
Parameter | Type | Description |
apiVersion | String | The version of the API. Set the value to eci.alibabacloud.com/v1. |
kind | String | The resource type. Set the value to ImageCacheList. |
metadata | ListMeta | The standard list metadata. |
Items | ImageCache[] | The image caches. |
ImageCache
Parameter | Type | Description |
apiVersion | String | The version of the API. Set the value to eci.alibabacloud.com/v1. |
kind | String | The resource type. Set the value to ImageCache. |
metadata | ObjectMeta | The metadata of the object. |
spec | ImageCacheSpec | The details of the image cache. |
status | ImageCacheStatus | The status of the image cache. |
ImageCacheSpec
Parameter | Type | Required | Description |
images | String[] | Yes | The images in the image cache. |
imagePullSecrets | String[] | No | The secrets of the private image repositories. Specify each secret in the namespace:secretName format. |
imageCacheSize | Int | No | The size of the image cache. Unit: GB. Value range: 20 to 32768. Default value: 20. |
retentionDays | Int | No | The retention period of the image cache in days. The parameter value ranges from 1 to 65536. By default, the parameter is empty, which indicates that the image cache does not expire. |
ImageCacheStatus
Parameter | Type | Description |
phase | String | The status 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 details of the events that occurred when the image cache was created. |
expireDateTime | Time | The time when the image cache expires. An image cache may expire at one of the following points in time:
|
CreateImageCache
Creates an image cache.
HTTP request
POST /apis/eci.alibabacloud.com/v1/imagecaches
curl 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
curl 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 image caches.
HTTP request
GET /apis/eci.alibabacloud.com/v1/imagecaches
curl request example
curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches'
curl response example
{
"apiVersion": "eci.alibabacloud.com/v1",
"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"
}
}
],
"kind": "ImageCacheList",
"metadata": {
"continue": "",
"resourceVersion": "647062964",
"selfLink": "/apis/eci.alibabacloud.com/v1/imagecaches"
}
}
GetImageCache
Queries information of an image cache.
HTTP request
GET /apis/eci.alibabacloud.com/v1/imagecaches/{name}
curl request example
curl -X GET 'http://127.0.0.1:8001/apis/eci.alibabacloud.com/v1/imagecaches/imagecache-secrets-test'
curl 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.
HTTP request
DELETE /apis/eci.alibabacloud.com/v1/imagecaches/{name}
curl request example
curl -X DELETE -H 'Content-Type: application/yaml' 'http://127.0.0.1:8001/apis/eci.alibabpacloud.com/v1/imagecaches/imagecache-secrets-test'
curl 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****"
}
}