This document describes how image cache works and its billing rules, creation, and usage method. You can use image cache to accelerate image pull during instance creation so as to expedite instance startup. This capability is applicable to EKS cluster Pods, supernodes, and container instances.
When image cache accelerates instance startup, it will start a container instance in advance to pull the image, store the image in a data disk with a customizable size, and use the data disk as the cache of cloud disk snapshot, that is, the image data is already stored in the snapshot. You can choose to automatically or manually match the image cache when creating a container instance or Pod, and the specified number of data disks will be created based on the image snapshot and directly mounted to the instance to avoid image layer download, speeding up container instance and Pod creation.
Compared with the image reuse capability, image cache has the following strengths:
The following resources are involved when you create an image cache, and their billing rules are as detailed below:
Billable Item | Description | Document |
---|---|---|
Image cache | When you create an image cache, you need to run a 2-core 4 GiB container instance to pull the image. After image cache creation, the container instance will be automatically released, and its billing will stop. | Product Pricing |
CBS data disk | When you create an image cache, you need to bind a Premium Cloud Storage data disk to store the image. The disk size is customizable and 20 GB by default. After image cache creation, the data disk will be automatically released, and its billing will stop. | Price Overview |
Snapshot | A snapshot will be created based on the above-mentioned data disk, and its lifecycle will be the same as that of the image cache. It is billed by usage duration and capacity. | Price Overview |
When the image cache is used, a Premium Cloud Storage data disk with the same capacity will be created based on the matched image cache snapshot and bound to the Pod. Therefore, in addition to the Pod creation fees, data disk fees will also be incurred.
When creating an EKS Pod or container instance, you can enable image cache in Advanced Configuration. There are two image cache match methods, which you can select as needed.
If you select Automatic match, the optimal image cache will be matched automatically according to the following match policy:
>! Note that if the versions are both "nginx:latest", the image cache can still be matched; however, as the creation time may be different, the versions may be inconsistent. Therefore, we recommend you specify the version clearly when creating an image cache and instance.
If the corresponding image cache fails to be matched, an image will be pulled normally.
You can specify a Pod annotation to use an image cache on supernodes. For more information, see EKS Annotation.
Automatically match:
eks.tke.cloud.tencent.com/use-image-cache: auto
Manually specify:
eks.tke.cloud.tencent.com/use-image-cache: imc-xxx
You can check whether the match succeeds in the instance creation event.
If the image cache is matched successfully, the following event will be displayed:
If this event is not displayed, no appropriate image caches have been matched.
Note that if you choose to manually match an image cache but it fails to be matched, an image will be pulled from the newly created data disk, and the following event will be displayed:
Was this page helpful?