Skip to content

Controller · manager

BootAsset controller

The BootAsset controller makes the boot medium that a BootAsset describes. The HostOperation controller then mounts it on a BMC with InsertMedia.

Reconciles
BootAsset (For). Controller name bootasset.
Writes
An artifact Secret bootasset-<name>, imager Jobs, files in the media store, and the BootAsset status.
Talks to
The image factory: it registers schematics and downloads installer images. It starts imager Jobs in pk-metal.
Requeue
While a download runs, every 5 seconds; after a failed download, after 1 minute. Otherwise none: Job and Secret events and TalosNode renders start the next pass.
Source
bootasset_controller.go
Kind Relation Why a change starts a pass
BootAsset For A new asset, or a changed spec.
Secret Owns The artifact Secret changed.
Job Owns An imager Job ended.
TalosNode Watches, the assets that name it The render of the node moved. The medium is built again.
spec.strategy What the controller does Carries a secret Served from
factory Registers the schematic with the image factory, writes the image URL, and downloads the image into the media store over verified TLS. No The media store, under a grant
configISO Packs the rendered config of the node into a small ISO and stores it in a Secret. Yes The media service, under a grant
embeddedInstaller Runs the imager in a Job to build one installer with the config inside. Yes The media store, under a grant
The BootAsset reconcile loop: branch on the strategy, then hold with a reason or set Ready.Read the BootAsset1Sweep the media storeasset goneBranch on spec.strategy2Get the inputsschematic, or the rendered config3Ready = FalseNodeNotFound, ConfigNotRendered …Build or address the image4Ready = FalseBuilding, BuildFailedWrite digest, size, URLReady = True5next pass: Job, Secret or node event
  1. Read the asset. If it is gone, delete the files in the media store that no asset owns.
  2. Choose the builder from spec.strategy.
  3. Get the inputs. For configISO and embeddedInstaller, the node must have a rendered config Secret.
  4. Build:
    • factory: register the schematic, then compute the URL. Ready means that the factory has the image.
    • configISO: pack the config. If the existing artifact has the same config digest, keep it.
    • embeddedInstaller: start an imager Job, wait for it, import its output into the store, and delete older builds.
  5. Write status.digest, status.size and status.url or the artifact reference. Set Ready to True.

The embeddedInstaller strategy builds in a Job, build-<asset>-<key>. The key is a hash of the config digest, the Talos version, the image, the kernel arguments and the extensions.

  • The imager image is pinned by digest for each Talos release. A release without a digest is not built. Add one with --imager-digest.
  • The pod runs as user 65532 under the restricted Pod Security profile: no root, no capabilities, read-only root file system, no service account token.
  • The config comes from the config Secret as a read-only volume. The command line never contains it.
  • An init container copies the manager binary into the pod. The imager runs through manager imager-run, which keeps the embedded config out of the log.
  • The pod runs on the node of the manager, because the media store is a ReadWriteOnce volume.
  • One retry, and a limit of 30 minutes.

See Manager for the flags.

The digest is the contract
An operation is approved for one artifact digest. The executor checks it when it mounts. A rebuilt artifact fails that check, so nothing boots a medium that nobody approved.
Status names the last good build
While a newer build runs, the status keeps the last artifact. Ready is False with Building.
Object or field When Field manager
Secret bootasset-<name> with asset.iso, owned by the asset configISO build manager (create or update)
Job build-…, owned by the asset embeddedInstaller build manager (create, delete)
Files in the media store Import and sweep the manager process
BootAsset status: Ready, url, digest, size, buildKey, artifact reference When it changed manager (status update)
Condition Status Reasons
Ready True ImageDownloaded, ArtifactBuilt
Ready False SchematicUnavailable, NodeNotFound, ConfigNotRendered, BuilderUnavailable, Building, BuildFailed
You see Cause Do this
Ready=False, BuilderUnavailable No media store, no store claim, or no imager digest for the version. Set the flags on the Manager.
Ready=False, BuildFailed The imager Job failed twice, or the download of a factory image failed. Read the Job log, then delete the Job. For a download, read the message: the manager tries again after 1 minute.
Ready=False, SchematicUnavailable The image factory does not answer. See Air-gapped site.
API groupResourcesVerbsScope
os.platform-kit.orgbootassetsgetlistwatchcluster
os.platform-kit.orgbootassets/statusupdatecluster
os.platform-kit.orgbootassets/finalizersupdatecluster
os.platform-kit.orgtalosnodesgetlistwatchcluster
coresecretsgetlistwatchcreateupdatenamespace pk-metal
batchjobsgetlistwatchcreatedeletenamespace pk-metal