Skip to content

Commit

Permalink
docs: update image-cache doc for iso
Browse files Browse the repository at this point in the history
Clarifying information from siderolabs#9892

Signed-off-by: Justin Garrison <justin.garrison@siderolabs.com>
  • Loading branch information
rothgar committed Dec 12, 2024
1 parent e1b824e commit 06d4cf1
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions website/content/v1.9/talos-guides/configuration/image-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ There are two supported boot asset types for the Image Cache: ISO and disk image

### ISO

> Note: ISO image cache only works with iso9660 filesystems.
> If you copy the ISO image to a USB stick, the image cache will not be available.
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]({{< relref "../install/boot-assets#imager" >}}) by passing an additional `--image-cache` flag:

```bash
mkdir -p _out/
docker run --rm -t -v $PWD/_out:/secureboot:ro -v $PWD/_out:/out -v /dev:/dev --privileged ghcr.io/siderolabs/imager:{{< release >}} iso --image-cache ./image-cache.oci
docker run --rm -t -v $PWD/_out:/secureboot:ro -v $PWD/_out:/out -v $PWD/image-cache.oci:/image-cache.oci:ro -v /dev:/dev --privileged ghcr.io/siderolabs/imager:{{< release >}} iso --image-cache /image-cache.oci
```

> Note: If the image cache was pushed to a container registry, the `--image-cache` flag should point to the image reference.
Expand All @@ -57,7 +60,7 @@ The disk image can be built with the [imager]({{< relref "../install/boot-assets

```bash
mkdir -p _out/
docker run --rm -t -v $PWD/_out:/secureboot:ro -v $PWD/_out:/out -v /dev:/dev --privileged ghcr.io/siderolabs/imager:{{< release >}} metal --image-cache ./image-cache.tar
docker run --rm -t -v $PWD/_out:/secureboot:ro -v $PWD/_out:/out -v $PWD/image-cache.oci:/image-cache.oci:ro -v /dev:/dev --privileged ghcr.io/siderolabs/imager:{{< release >}} metal --image-cache /image-cache.oci
```

> Note: If the image cache was pushed to a container registry, the `--image-cache` flag should point to the image reference.
Expand All @@ -79,21 +82,22 @@ machine:
Once enabled, Talos Linux will automatically look for the image cache contents either on the disk or in the ISO image.
If the image cache is bundled with the ISO image, the disk volume for the image cache should be configured in the Talos configuration to copy the image cache to the disk during the installation process:
If the image cache is bundled with the ISO, the disk volume size for the image cache should be configured to copy the image cache to the disk during the installation process:
```yaml
apiVersion: v1alpha1
kind: VolumeConfig
name: IMAGECACHE
provisioning:
diskSelector:
match: 'system_disk'
match: "system_disk"
minSize: 2GB
maxSize: 2GB
```
In this example, image cache volume is provisioned on the system disk with a fixed size of 2GB.
In this example, image cache volume is provisioned on the system disk with a fixed size of 2GB (default is 1GB).
The size of the volume should be adjusted to fit the image cache.
You can see the size of your cache by looking at the size of the image-cache.oci folder with `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.

Expand All @@ -120,12 +124,13 @@ The current status of the image cache can be checked via the `ImageCacheConfig`
```yaml
# talosctl get imagecacheconfig -o yaml
spec:
status: ready
copyStatus: ready
roots:
- /system/imagecache/disk
- /system/imagecache/iso/imagecache
status: ready
copyStatus: ready
roots:
- /system/imagecache/disk
- /system/imagecache/iso/imagecache
```

The `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.

0 comments on commit 06d4cf1

Please sign in to comment.