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.
At a glance
Section titled “At a glance”- Reconciles
- TalosNode (
For). Controller namestalosnodeandtalosnode-member. - Writes
- A config Secret for each render, named by the config digest, and the node status.
- Finalizer
os.platform-kit.org/member(fromtalosnode-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.
Watches
Section titled “Watches”| 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. |
Reconcile loop
Section titled “Reconcile loop”- Read the node. During a deletion, only
talosnode-memberwrites. - Read the TalosCluster and its secrets bundle.
- Resolve the config patches of the cluster and of the node from their ConfigMaps. A ConfigMap without the label
os.platform-kit.org/patchstops the render, and the condition names the command that adds the label. - Register the schematic with the image factory, so that the installer image of the config exists.
- 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.
- If a Host hands this node out, check in: the machine API with a short-lived client certificate first, the maintenance service second.
- Update the status. Delete config Secrets that the status no longer names.
Check-in and drift
Section titled “Check-in and drift”| 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.
The member finalizer
Section titled “The member finalizer”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:
- No claim records an install of the node.
- No unfinished operation acts on the node.
- 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.
Writes
Section titled “Writes”| 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) |
Failure modes
Section titled “Failure modes”| 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. |
Permissions
Section titled “Permissions”| API group | Resources | Verbs | Scope | Marker in |
|---|---|---|---|---|
os.platform-kit.org | talosnodes | getlistwatch | cluster | talosnode_controller.go |
os.platform-kit.org | talosnodes/status | update | cluster | talosnode_controller.go |
os.platform-kit.org | talosnodes/finalizers | update | cluster | talosnode_controller.go |
os.platform-kit.org | talosclusters | getlistwatch | cluster | talosnode_controller.go |
metal.platform-kit.org | hosts | getlistwatch | cluster | talosnode_controller.go |
core | secrets | getlistwatchcreateupdate | namespace pk-metal | talosnode_controller.go |
core | configmaps | getlistwatch | namespace pk-metal | talosnode_controller.go |
core | secrets | delete | namespace pk-metal | talosnode_day2.go |
metal.platform-kit.org | hostoperations | getlistwatch | cluster | talosnode_day2.go |
os.platform-kit.org | talosrollouts | getlistwatch | cluster | talosnode_day2.go |
os.platform-kit.org | talosnodes | getlistwatchupdate | cluster | talosnode_finalizer.go |
os.platform-kit.org | talosnodes/status | update | cluster | talosnode_finalizer.go |
os.platform-kit.org | talosnodes/finalizers | update | cluster | talosnode_finalizer.go |
metal.platform-kit.org | hostclaims | getlistwatch | cluster | talosnode_finalizer.go |
metal.platform-kit.org | hostoperations | getlistwatch | cluster | talosnode_finalizer.go |