Skip to content

Controller · manager

TalosRollout controller

The TalosRollout lane changes a running cluster one node at a time: a Talos upgrade, a Kubernetes upgrade, or a config change. rolloutproposer proposes the TalosRollout that a cluster needs. talosrollout plans it and, after one approval, runs it.

Reconciles
TalosRollout (talosrollout) and TalosCluster (rolloutproposer).
Writes
The rollout plan and step status, one HostOperation for each node step, and new rollouts (proposer).
Approval
One approval for the whole plan. It names the planHash that the person read.
Talks to
The Talos API of the control planes (etcd gate), the Kubernetes API of the cluster, and the image registry to pin installer images.
Requeue
1 minute while the plan waits for approval. 15 seconds while a step runs or a gate holds.
Metrics
pk_metal_rollout_nodes_done and pk_metal_rollout_nodes_total.
Controller Kind Relation Why a change starts a pass
talosrollout TalosRollout For Approval, pause, resume or abort.
talosrollout HostOperation Owns A node step moved.
talosrollout TalosNode Watches, the unapproved rollouts of its cluster Drift or version of a node changed. The plan is made again.
rolloutproposer TalosCluster For The target versions changed.
rolloutproposer TalosNode, TalosRollout Watches A node drifted, or a rollout ended.
A rollout plan: control planes one at a time, then kube-proxy for a Kubernetes upgrade, then workers up to maxUnavailableWorkers at once. A canary pause follows the first node.cp-1first nodepauseresume?cp-2cp-3kube-proxyk8s onlyworker-1worker-2worker-3health gate before each start: etcd healthy, all Nodes Ready
Control planes go one by one. Workers go in groups. A person resumes after the first node.
The rollout reconcile loop: plan while unapproved; once approved, check the plan hash, observe steps, stop on failure or abort, pause, gate, start the next steps.Read the rollout1unapprovedPlan passnot approved: write plan, planHashApproval covers the plan?2noComplete = FalsePlanChanged, nothing ranObserve the running steps3Failed or aborted?4yesSkip pending stepsRolloutFailed / RolloutAbortedPick the next steps5none leftComplete = TrueRolloutSucceededPaused?6yesPaused = TruePausedByPerson / CanaryPauseHealth gateearlier rollout, etcd, Nodes7ProgressingWaitingForHealthStart: create HostOperations8next pass: 15 s
  1. Read the rollout. If nobody approved it, plan it. List the nodes that need the change, pin each installer image by digest, and write the plan and its hash. Plan again each minute.
  2. Check that the approval names the current planHash. The approval is write-once, so a plan that moved after approval ends the rollout. Nothing ran.
  3. Observe each running step through its operation, or the kube-proxy DaemonSet.
  4. If a step failed or a person aborted, mark the pending steps Skipped. Wait for running steps to finish. Nodes that changed stay changed.
  5. Pick the next steps: control planes and kube-proxy one at a time, workers up to maxUnavailableWorkers.
  6. Pause if spec.paused is set, or after the first node until a person resumes it with the plan hash.
  7. Gate: no earlier rollout of the cluster runs, every etcd member answers and votes, and every Kubernetes Node is Ready. The gate reads live, not from a status.
  8. Start each step: create a HostOperation with rolloutRef and no approval of its own.

rolloutproposer acts only on a bootstrapped cluster with no unfinished rollout. It proposes the first need in this order:

  1. A TalosUpgrade when a node runs another Talos version than the spec.
  2. A KubernetesUpgrade when the API runs another Kubernetes version.
  3. A Config rollout for the nodes whose dry run reports drift.

The name comes from a hash of what it proposes, so the same need is not proposed twice. A failed or aborted rollout stays until a person deletes it.

One approval, bound to a hash
The executor runs a rollout operation only while the rollout approval covers its plan hash, node, host and actions. See HostOperation controller.
Canary pause
After the first node succeeds, the rollout stops until the annotation os.platform-kit.org/resume equals the plan hash. Use pk-metal rollout.
One rollout for each cluster
Two rollouts side by side could take two control planes down at once.
Object or field When Field manager
Rollout status: plan, planHash, steps, conditions Each pass manager (status update)
HostOperation for each node step, owned by the rollout Step start manager (create)
kube-proxy DaemonSet in the workload cluster Kubernetes upgrade through the admin kubeconfig
New TalosRollout (proposer) A need appears manager (create)
Condition Reasons
Approved AwaitingApproval, PlanApproved, PlanChanged
Planned PlanReady, PlanBlocked
Progressing RolloutNotStarted, NodeRunning, WaitingForHealth, CanaryPause, PausedByPerson, RolloutSucceeded, RolloutFailed, RolloutAborted, PlanChanged
Paused PausedByPerson, CanaryPause, NotPaused
Complete RolloutSucceeded, NothingToDo, RolloutFailed, RolloutAborted, PlanChanged
You see Cause Do this
Progressing, WaitingForHealth Etcd or a Node is not healthy. Use Node not ready or etcd unhealthy or quorum lost.
Complete=False, RolloutFailed A node step failed. Use Operation failed.
Complete=False, PlanChanged The plan moved after approval. Delete the rollout. The proposer makes a new one.
API groupResourcesVerbsScopeMarker in
os.platform-kit.orgtalosrolloutsgetlistwatchcreatedeleteclustertalosrollout_controller.go
os.platform-kit.orgtalosrollouts/statusupdateclustertalosrollout_controller.go
os.platform-kit.orgtalosrollouts/finalizersupdateclustertalosrollout_controller.go
os.platform-kit.orgtalosclustersgetlistwatchclustertalosrollout_controller.go
os.platform-kit.orgtalosnodesgetlistwatchclustertalosrollout_controller.go
metal.platform-kit.orghostsgetlistwatchclustertalosrollout_controller.go
metal.platform-kit.orghostoperationsgetlistwatchcreateclustertalosrollout_controller.go
coresecretsgetlistwatchnamespace pk-metaltalosrollout_controller.go
os.platform-kit.orgtalosrolloutsgetlistwatchcreateclustertalosrollout_proposer.go