Skip to content

Controller · manager

TalosNode controller

The TalosNode controller renders the machine config of each TalosNode and checks in with the machine that runs it. A second controller in the same lane, talosnode-member, holds a deleted node until it left its cluster.

Reconciles
TalosNode (For). Controller names talosnode and talosnode-member.
Writes
A config Secret for each render, named by the config digest, and the node status.
Finalizer
os.platform-kit.org/member (from talosnode-member).
Talks to
The image factory (registers the schematic) and the Talos API of the machine.
Requeue
10 seconds while a machine converges. 2 minutes once it is Ready. 10 seconds during a rollout of its cluster. 30 seconds while a deletion waits.
Drift check
Each 10 minutes for a Ready node, each 30 seconds during a rollout.
Kind Relation Why a change starts a pass
TalosNode For You changed the node.
Secret Owns, and Watches the secrets bundles A config Secret changed, or the bundle of the cluster appeared or changed.
TalosCluster Watches, all members The cluster spec moved. All members render again.
ConfigMap Watches A patch ConfigMap that the node or its cluster uses changed.
TalosRollout Watches A rollout of the cluster started. The drift check is faster.
Host Watches, the node in spec.os A hand-off started or ended.
HostClaim, HostOperation Watches (talosnode-member) The removal of a deleted node moved.
The TalosNode reconcile loop: read the cluster and the bundle, resolve patches, register the schematic, render, write the Secret, check in.Read the node1Stopbeing deletedRead the TalosCluster and bundle2Rendered = FalseClusterNotFound, SecretsUnavailableResolve the patches3Rendered = FalsePatchesUnresolvableRegister the schematic4Rendered = FalseSchematicUnavailableRender, write the config Secretcontent-addressed, never rewritten5Rendered = FalseUnsupportedVersion, RenderFailedCheck in with the machineonly if a Host runs the node6Update status, collect old Secrets7next pass: 10 s, 2 min, or an event
One pass of the talosnode controller. Each render exit sets Rendered to False and keeps the last good Secret.
  1. Read the node. During a deletion, only talosnode-member writes.
  2. Read the TalosCluster and its secrets bundle.
  3. Resolve the config patches of the cluster and of the node from their ConfigMaps. A ConfigMap without the label os.platform-kit.org/patch stops the render, and the condition names the command that adds the label.
  4. Register the schematic with the image factory, so that the installer image of the config exists.
  5. Render for the Talos version that the machine runs, while it is older than the cluster version. Write the config into a Secret named by its digest.
  6. If a Host hands this node out, check in: the machine API with a short-lived client certificate first, the maintenance service second.
  7. Update the status. Delete config Secrets that the status no longer names.
Machine answers MachineReachable Ready
Machine API, stage running and ready True, MachineAPI True, NodeReady
Machine API, other stage True, MachineAPI Unknown, Converging
Maintenance service True, MaintenanceMode Unknown, MaintenanceMode
Nothing False, DialFailed Unknown, AwaitingContact
No address False, NoAddress Unknown, AwaitingContact

For a Ready node, the controller does a dry-run apply of the current render. It sets ConfigInSync (ConfigDrift, DriftUnknown) and VersionCurrent. The TalosRollout controller proposes a rollout from these conditions.

talosnode-member adds os.platform-kit.org/member to each node. When you delete a node, it removes the finalizer only when nothing of the node is left:

  1. No claim records an install of the node.
  2. No unfinished operation acts on the node.
  3. For a control plane of a running cluster, etcd lists no member with its name.

While it waits, RemovalBlocked is True with MachineAssigned, EtcdMemberRemains or EtcdUnreadable. It proposes nothing. The claim that holds the machine proposes the removal. See Remove a node.

Object or field When Field manager
Config Secret, owned by the node New render manager (create)
Node status (Rendered, MachineReachable, Ready, ConfigInSync, VersionCurrent, address, digest, drift) When it changed manager (status update)
Finalizer os.platform-kit.org/member, RemovalBlocked Add on create, remove at the end manager (update)
You see Cause Do this
Rendered=False, SecretsUnavailable The secrets bundle is missing. Create the bundle Secret of the cluster.
Ready=Unknown, AwaitingContact The machine does not answer. Use Node not ready.
RemovalBlocked=True, EtcdMemberRemains Etcd still lists the node. See Remove a node.
API groupResourcesVerbsScopeMarker in
os.platform-kit.orgtalosnodesgetlistwatchclustertalosnode_controller.go
os.platform-kit.orgtalosnodes/statusupdateclustertalosnode_controller.go
os.platform-kit.orgtalosnodes/finalizersupdateclustertalosnode_controller.go
os.platform-kit.orgtalosclustersgetlistwatchclustertalosnode_controller.go
metal.platform-kit.orghostsgetlistwatchclustertalosnode_controller.go
coresecretsgetlistwatchcreateupdatenamespace pk-metaltalosnode_controller.go
coreconfigmapsgetlistwatchnamespace pk-metaltalosnode_controller.go
coresecretsdeletenamespace pk-metaltalosnode_day2.go
metal.platform-kit.orghostoperationsgetlistwatchclustertalosnode_day2.go
os.platform-kit.orgtalosrolloutsgetlistwatchclustertalosnode_day2.go
os.platform-kit.orgtalosnodesgetlistwatchupdateclustertalosnode_finalizer.go
os.platform-kit.orgtalosnodes/statusupdateclustertalosnode_finalizer.go
os.platform-kit.orgtalosnodes/finalizersupdateclustertalosnode_finalizer.go
metal.platform-kit.orghostclaimsgetlistwatchclustertalosnode_finalizer.go
metal.platform-kit.orghostoperationsgetlistwatchclustertalosnode_finalizer.go