Preparing Image Cache
First, build a list of image references that need to be cached. Thetalosctl 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-createsupports a--layer-cacheflag to additionally cache the pulled images layers on the filesystem. This is useful to speed up repeated calls forcache-createwith 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:
Building Boot Assets
The image cache is provided to Talos via the boot assets. There are two supported boot asset types for the Image Cache: ISO and disk image.ISO
In case of ISO, the image cache is bundled with a Talos ISO image, it will be available for the initial install and (if configured) copied to the disk during the installation process. The ISO image can built with the imager by passing an additional--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):
- Using a physical or virtual CD/DVD drive.
- Copying the ISO image to a USB drive using
dd. - Copying the contents of the ISO image to a FAT-formatted USB drive with a volume label that starts with
TALOS_, such asTALOS_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.
Disk Image
In case of disk image, the image cache is included in the disk image itself, and on boot it would be used immediately by the Talos. The disk image can be built with the imager by passing an additional--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.
Configuration
The image cache feature (for security reasons) should be explicitly enabled in the Talos configuration:IMAGECACHE volume are as follows (note that a configuration should still be provided to enable the image cache volume provisioning):
minSize: 500MBmaxSize: 1GBdiskSelector: 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 System Volumes for more information on volume configuration.
Updating the Image Cache
The image cache is initially populated during installation from the boot media (ISO or disk image) and stored on disk. Over time, you may want to update or refresh the cached images without reinstalling the node. To update the image cache on a live node, attach a new cache media as a secondary device. You can create this media by bundling your updated image cache into a new ISO or disk image, as explained in the Bundling Boot Assets section of this documentation. Once attached, Talos mounts the media under/system/imagecache/iso/imagecache and copies its contents into the on-disk IMAGECACHE partition.
After the copy is complete, the new images are immediately available on the node and can be pulled directly from the cache.
This process allows you to refresh cached images without rebuilding or reinstalling the node.
Note: You can update the image cache using any medium described in the documentation for building boot assets. The media does not need to have Talos installed or be bootable itself, it only needs to provide the cache contents.
Limitations of Live Image Cache Updates
Only images baked into the ISO or USB are copied. There is no way to push arbitrary new images directly into the cache on a running system. For dynamic updates or for caching non-container artifacts (e.g., Helm charts, FluxCD manifests), use a dedicated registry mirror (registry:2, Harbor, Quay, Zarf, etc.), since the Talos cache is not exposed as a network-accessible registry.
Troubleshooting
When the image cache is enabled, Talos will block on boot waiting for the image cache to be available: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).