How to enable and configure Talos image cache feature.
talosctl images default
might be used as a starting point, but it should be customized to include additional images (e.g. custom CNI, workload images, etc.)
Note: TheThe OCI image cache directory might be used directly (cache-create
supports a--layer-cache
flag to additionally cache the pulled images layers on the filesystem. This is useful to speed up repeated calls forcache-create
with the same images.
./image-cache.oci
) or pushed itself to a container registry of your choice (e.g. with crane push
).
Example of pushing the OCI image cache directory to a container registry:
--image-cache
flag:
Note: If the image cache was pushed to a container registry, the --image-cache
flag should point to the image reference.
SecureBoot ISO is supported as well.
The ISO image can be utilized in the following ways (which allows both booting Talos and using the image cache):
dd
.TALOS_
, such as TALOS_1
(only for UEFI systems).Note: Third-party boot loaders, such as Ventoy, are not supported as Talos will not be able to access the image cache.
--image-cache
flag:
Note: If the image cache was pushed to a container registry, the --image-cache
flag should point to the image reference.
For a disk image, the IMAGECACHE
partition will use all available space on the disk image (excluding the mandatory boot partitions).
Therefore, you may need to adjust the disk image size using the --image-disk-size
flag to ensure the IMAGECACHE
partition is large enough to accommodate the image cache contents, for example, --image-disk-size=4GiB
.
Upon boot, Talos will expand the disk image to utilize the full disk size.
IMAGECACHE
volume are as follows (note that a configuration should still be provided to enable the image cache volume provisioning):
minSize: 500MB
maxSize: 1GB
diskSelector: match: system_disk
du -sh image-cache.oci
.
If the disk image is used, the IMAGECACHE
volume doesn’t need to be configured, as the image cache volume is already present in the disk image.
See disk management for more information on volume configuration.
ImageCacheConfig
resource:
status
field indicates the readiness of the image cache, and the copyStatus
field indicates the readiness of the image cache copy.
The roots
field contains the paths to the image cache contents, in this example both on-disk and ISO caches are available.
Image cache roots are used in order they are listed.
You can get logs from the registry to see if images are being “hit” (a.k.a. cached) or “missed” (a.k.a. pulled from upstream).