The Image Factory is a way for you to dynamically create Talos Linux images. There is a public, hosted version of the Image Factory at factory.talos.dev and it can also be run in your environment.
The Image Factory is a critical component of Omni to generate installation media and update Talos nodes, but it is not required to use Omni to use the Image Factory. It is a web interface and API for the imager command which is used to customize Talos from the command line.
Prerequisites
Podman is known to work but has some flags that are different than docker and you may have to translate them for your version of podman.
Container registry
If you already have a container registry available you can export your registry to an environment variable. and skip to create an image cache signing key.
If you don’t have a container registry available to push images to you can temporarily run one with the registry container. We recommend using the official registry:2 registry from docker as some registries do not support all OCI images.
This example doesn’t have persistent storage.
Secure registry
Insecure registry
Air-gapped
We recommend using certificates for your temporary registry you will need to provide your own certificates and mount them into the container at run time. If you do not have certificates, follow the steps in the Omni air-gapped documentation.Make sure the CA certificate is in your system pki path and docker has restarted to trust the certificate. A registry can be run without certificates or encrypted communication. Running this way will require your to add a flag to crane and docker to allow insecure communication. Without internet access you will need to download the container image, transfer it internally, and load it on the target machine.Transfer the registry.tar and image-factory.tar files to an internal system.Run the registry with certificates.
Image cache signing key
You need to create a Cache Signing Key to sign cached Talos image artifacts, ensuring they haven’t been tampered with before being served.
Image cache storage (optional)
There are a variety of image cache locations to store built images. Without an image cache, each asset will be built on demand which can consume a high amount of CPU on the image factory machine.
Some supported cache storage options include:
- CDN
- s3 bucket (or compatible API)
Please view the --help output for cache options.
Run Image Factory
There are two supported methods to run the Image Factory:
- Connected to the upstream Sidero container registry
- Using a custom container registry
A custom container registry is required for air-gapped environments or custom Talos builds.
Image factory connected
Image Factory air-gapped
Run with the official, upstream container registry if your machine is connected to the internet and you don’t need custom Talos images.
The official Sidero Labs registry has all of the required Talos installation containers, extensions, and tools.Export the URL for where you will be hosting the Image Factory.You need to provide a registry where image schematics can be stored. Create a config file.If you want to run image factory connected to the upstream container registry you can do it with:This will run the image factory on your machine on port 8080 and automatically pull container images from Sidero’s registry. It will also validate image signatures using cosign to validate pulled images.This will not allow you to create or publish custom system extensions.
To do that you will need to run your own container registry with the necessary images. See the disconnected instructions for Image Factory.Run with an internal container registry if your machine is not connected to the internet, or you need custom Talos images and extensions.
Running the image factory in an air-gapped environment has more requirements than running in a connected mode. Make sure you have a registry running from the Internal container registry section. You will need to download container images and seed them into the internal registry and sign the container images.
This is just an example and should not be used in a production environment. If you want to test locally on your machine you can also see the developer documentation in the repository.
Download container images
Starting with Talos 1.12 you can get a list of images needed to seed the image factory directly from talosctl.Get a list of Talos base images needed for the image factory with:This will give you a list of all images and extensions for Talos .
You will need to repeat this command for each version of Talos you want to download images for.
If you don’t need specific extensions you can delete them from the images.txt file.Push the images to your $REGISTRY_ENDPOINT Internet available
Air-gapped
If your machine can reach the public internet and the internal registry at the same time you can copy the images internally with this command. If you don’t have direct access to an internal container registry (e.g. air gapped environment) you need to download the container images while connected to the internet.Download all images from images.txt. Create file names that don’t contain special characters.Move to a network that has access to the $REGISTRY_ENDPOINT endpoint and push the local images to the registry.
This serves the container layers on your local admin machine port :5000 so you can push them with crane.
Run this command command from your admin machine so you do not have port conflicts with the $REGISTRY_ENDPOINT.This method of copying containers is important because Talos releases pin to a container digest which needs to match in your internal registry
Push the container images with crane. Sign container images
The Image Factory verifies container image signatures when being used. Generate a cosign singing key and sign each container pushed to the registry.Image factory currently only supports cosign v2 signatures.
Generate a cosign key.Sign each image and tag in your internal registry. This will allow the registry to validate images without reaching out to any external services for key validation.Sign all of the images using the images.txt file as a list.
If your registry is running with a self-signed CA certificate (i.e. from the Installing Airgapped Omni guide) you need to mount the CA certificate into the cosign container for it to be trusted.
This guide assumes the container registry and image factory are running on the same machine. Because of this we will run the Image Factory with --net=host which is not recommended for a production, multi-host deployment.
Set a internal factory endpoint.Create a configuration file for the Image Factory.To run the image factory with a self-signed CA certificate you need to mount them into the container image at run time.You should now be able to browse to https://registry.internal:8080 and view the Image Factory web interface. If your server or network has any firewall rules you may need to allow TCP traffic to the host. Set a internal factory endpoint.Create a configuration for the Image FactoryIf your image factory and container registry do not have certificates run the following command:You should now be able to browse to http://registry.internal:8080 and view the Image Factory web interface. If your server or network has any firewall rules you may need to allow TCP traffic to the host.
Run Omni
After the image factory is running you can continue to the Omni Airgapped documentation.