Skip to content

Kind · os.platform-kit.org/v1alpha1

TalosRollout

A TalosRollout is one change to all nodes of a TalosCluster: a Talos upgrade, a Kubernetes upgrade, a config change or a reboot. One approval covers the full plan. The operator then changes one node at a time and checks the cluster between nodes.

Group and version
os.platform-kit.org/v1alpha1
Scope
Cluster.
Written by
The Rollout proposer, or you for a Reboot. The approver writes spec.approval.
Reconciled by
TalosRollout controller
Makes
One HostOperation for each node, with spec.rolloutRef.
Conditions
Planned, Approved, Progressing, Paused, Complete.
Commands
pk-metal upgrade, pk-metal rollout
spec.kind Change on each node Reboot Proposed by the operator when
TalosUpgrade TalosUpgrade to target.talosVersion yes a node runs another version than spec.talosVersion
KubernetesUpgrade TalosApplyConfig with the new kubelet and control-plane images only if the node needs it the API server reports another version than spec.kubernetesVersion
Config TalosApplyConfig with the current render only if the node needs it a node reports drift
Reboot TalosReboot yes never: you create it

The operator checks these cases in this order and proposes only the first that applies. While a rollout of the cluster is not finished, it proposes nothing new. It does not propose a failed or aborted rollout again. Delete that rollout to get a new proposal.

Before the approval, the operator writes the plan to status.plan on each pass:

  1. Control planes, one at a time. The etcd leader goes last, so etcd elects a new leader only one time.
  2. For a KubernetesUpgrade: one KubeProxy step that moves the kube-proxy DaemonSet to the new image.
  3. Workers, at most spec.maxUnavailableWorkers at a time.

Each step names the node, its Host, the change (from, to), the pinned image or config digest, and the actions. status.planHash is a sha256 over the cluster, the kind, the target, the drain policy and all steps.

The actions of a node step:

drain → change → waitNodeReady → waitEtcdHealthy* → uncordon

drain and uncordon are only for a change that reboots the node. waitEtcdHealthy is only for a control plane.

Roll a Talos upgrade through a cluster

1 / 8

A TalosRollout upgrades three control planes one at a time with the etcd leader last, pauses after the first node, then upgrades the workers two at a time.TalosRollout-Youapprove, resumeHealth gateetcd healthy, Nodes ReadyplanHashcontrol planes, one at a timeworkers, two at a timecp-1v1.14.6cp-2v1.14.6cp-3 leaderv1.14.6w-1v1.14.6w-2v1.14.6w-3v1.14.6w-4v1.14.6HostOperation for each node-

Propose

You raise spec.talosVersion. The operator proposes a TalosRollout. The plan puts control planes first, the etcd leader last, then workers.

pk-metal upgrade talos lab v1.14.7
  1. Propose. You raise spec.talosVersion. The operator proposes a TalosRollout. The plan puts control planes first, the etcd leader last, then workers.

    pk-metal upgrade talos lab v1.14.7
  2. Approve the plan. A person approves the plan hash. The plan is frozen from now on. One approval covers every node.

    pk-metal rollout approve lab-talosupgrade-1a2b3c4d
  3. First control plane. The operator creates one HostOperation for cp-1. It carries rolloutRef and needs no approval of its own.

    drain → talosUpgrade → waitNodeReady → waitEtcdHealthy → uncordon
  4. Pause after the first node. The first node is done. The rollout always stops here. Look at the node, then resume.

    pk-metal rollout resume lab-talosupgrade-1a2b3c4d
  5. Health gate, then cp-2. Before each node, the operator asks etcd and Kubernetes again. All members healthy and voting, all Nodes Ready: the next control plane starts.

  6. The leader goes last. cp-3 leads etcd. It is the last control plane, so etcd elects a new leader only one time.

  7. Workers, two at a time. With spec.maxUnavailableWorkers: 2, two workers change at the same time. Control planes always go one at a time.

  8. Complete. The last workers are done. The rollout sets Complete=True. If a node fails, the rollout stops and the other nodes are Skipped.

    pk-metal rollout show lab-talosupgrade-1a2b3c4d
  • Approval. The approver names the planHash that they saw. After the approval, the plan is frozen.
  • Plan changed. If the plan that the operator would make now differs from the approved plan, the rollout ends with Complete=False, reason PlanChanged. Nothing runs.
  • Pause after the first node. The rollout always stops after the first node. pk-metal rollout resume sets os.platform-kit.org/resume to the plan hash.
  • Health gate. Before each step, the operator asks etcd and Kubernetes again. It needs a leader, no member with an error, no learner, all control planes as members and all other Nodes Ready. Until then, the reason is WaitingForHealth.
  • One rollout per cluster. A second approved rollout waits until the first one ends.
  • Failure. A step fails: the rollout stops with RolloutFailed. The steps that did not start are Skipped.

A ValidatingAdmissionPolicy enforces the same rules as for a HostOperation:

  1. The creator must name themselves in spec.proposedBy.
  2. The approver is a person, never the operator. The approver is not the proposer if the site sets selfApproval: Forbidden.
  3. approvedBy and planHash are set together, and cannot change after that.

Before each node operation starts, the HostOperation controller checks that this rollout still covers it. If not, the operation fails with RolloutRefused and the machine does not change.

Rules for the whole spec (the API server refuses a change that breaks one):

  • clusterRef and kind are frozen after creation
  • target is frozen after creation
  • nodes are frozen after creation
  • proposedBy is frozen after creation
  • requestedBy is frozen after creation
  • an abort cannot be taken back
  • maxUnavailableWorkers is frozen after creation
  • drainTimeoutSeconds is frozen after creation
FieldTypeDescription
abortbooleanAbort stops the rollout for good: no further node starts, a node in the middle of its change finishes it, and nodes already changed stay as they are. It cannot be taken back; a new rollout is how to go on.
approvalobjectApproval is the one human gate of the whole rollout.
  • Rule: approvedBy and planHash are set together: an approval names the plan it approves
approvedBystringApprovedBy is the person who approved. Admission enforces that it equals the requesting username, is empty at creation, is write-once, and is not the operator; it is the proposer only where the site allows self-approval.
planHashstringPlanHash is the status.planHash the approver saw. The rollout runs only while it equals status.planHash: a plan that changed after it was shown is not the plan that was approved.Pattern: ^sha256:[a-f0-9]{64}$
clusterRefrequiredobjectClusterRef names the TalosCluster whose nodes this rollout changes.
namerequiredstringThe name of the object.
drainTimeoutSecondsinteger (int32)DrainTimeoutSeconds bounds the drain of each node that is drained (an upgrade, a reboot, a config that needs a reboot). It is part of what is approved, so it is frozen after creation.Default: 900Bounds: 30 to 86400
kindrequiredstringKind is what changes on each node.ConfigTalosUpgradeKubernetesUpgradeReboot
maxUnavailableWorkersinteger (int32)MaxUnavailableWorkers is how many workers may be in the middle of the change at once. Control planes always go one at a time, and only while etcd keeps every member healthy.Default: 1Bounds: 1 to 100
nodes[]stringNodes limits the rollout to these TalosNodes. Empty means every node of the cluster that needs the change.
pausedbooleanPaused stops the rollout from starting another node. A node already in the middle of its change finishes it. Set and clear it at will.
proposedByrequiredstringProposedBy is the username that created the rollout. Admission checks it against the creating request. Whether the same person may also approve it is a site setting (selfApproval in the ConfigMap pk-metal/hostoperation-approval, default Allowed).Bounds: at least 1 characters
requestedBy[]stringRequestedBy names the people whose change made the operator propose this rollout: the metal.platform-kit.org/requested-by annotations of the cluster, its nodes and its patch ConfigMaps. It is frozen after creation; if one of them names someone else before the approval, the rollout ends (PlanChanged) and the operator proposes it again. Where the site forbids self-approval, none of them may approve it.Bounds: at most 32 items
targetobjectTarget is where the rollout takes the nodes: the Talos version of a TalosUpgrade, the Kubernetes version of a KubernetesUpgrade. A Config or Reboot rollout takes none; its target is each node's current rendered config, frozen into the plan.
kubernetesVersionstringKubernetesVersion is the Kubernetes release of a KubernetesUpgrade.Pattern: ^v[0-9]+\.[0-9]+\.[0-9]+$
talosVersionstringTalosVersion is the Talos release of a TalosUpgrade.Pattern: ^v1\.(1[4-9]|[2-9][0-9])\.[0-9]+$
FieldTypeDescription
conditions[]objectConditions: Planned, Approved, Progressing, Paused, Complete.
plan[]objectPlan is the ordered list of steps: control planes first, one at a time, then a KubeProxy step for a Kubernetes upgrade, then the workers. Rewritten on every pass until approved, frozen afterwards.
actions[]stringActions are the HostOperation action keys this step runs, in order, for the approver to read.
configDigeststring
configSecretstringConfigSecret and ConfigDigest pin the rendered config a Config or KubernetesUpgrade step applies. The Secret is content-addressed and never rewritten, so the bytes approved are the bytes applied.
fromstringFrom is what the node runs now, as far as the operator knows (a version, or the digest of the config it last confirmed); To is what it runs afterwards.
hoststring
imagestringImage is the installer image of a TalosUpgrade, pinned by digest, or the kube-proxy image of a KubeProxy step.
kindrequiredstringKind is Node (one node through a HostOperation) or KubeProxy.NodeKubeProxy
nodestringNode is the TalosNode; Host the Host that runs it. Empty for a KubeProxy step.
rebootRequiredbooleanRebootRequired: the node said, in a dry run, that it cannot take this config without a reboot. The node is then drained, the config applied with a reboot, and the node uncordoned once it is back.
rolestringRole is the node's role; control planes go one at a time.controlplaneworker
tostring
planHashstringPlanHash is sha256 over the kind, cluster, target and plan: what an approval names, and what every HostOperation of the rollout carries.
steps[]objectSteps is the progress of each plan entry, by index.
finishedAtstring (date-time)
messagestringMessage says why a step failed or what it waits for.
operationstringOperation is the HostOperation (namespace/name) running a Node step.
startedAtstring (date-time)
staterequiredstringState is Pending, Running, Succeeded, Failed or Skipped.PendingRunningSucceededFailedSkipped

Columns of kubectl get talosrollouts (the columns marked wide show only with -o wide):

ColumnValue
NAME.metadata.name
CLUSTER.spec.clusterRef.name
KIND.spec.kind
APPROVED.spec.approval.approvedBy
PROGRESS.status.conditions[?(@.type=="Progressing")].reason
COMPLETE.status.conditions[?(@.type=="Complete")].status
AGE.metadata.creationTimestamp
Condition Reasons
Planned PlanReady, PlanBlocked, NothingToDo
Approved AwaitingApproval, PlanApproved, PlanChanged
Progressing NotStarted, NodeRunning, WaitingForHealth, PausedAfterFirstNode, PausedByPerson, Succeeded, RolloutFailed, Aborted, PlanChanged
Paused PausedAfterFirstNode, PausedByPerson, NotPaused
Complete Succeeded, NothingToDo, RolloutFailed, Aborted, PlanChanged

Each step in status.steps is Pending, Running, Succeeded, Failed or Skipped.

PlanChanged means that the plan changed after a person approved it. Nothing ran. The rollout ends, and the operator proposes a new one.

Terminal window
$ pk-metal upgrade talos lab v1.14.7
$ kubectl get talosrollouts
NAME CLUSTER KIND APPROVED PROGRESS COMPLETE AGE
lab-talosupgrade-1a2b3c4d lab TalosUpgrade NotStarted 1m
Column Shows
APPROVED The name of the approver. Empty before the approval.
PROGRESS The reason of the condition Progressing, for example NodeRunning.
COMPLETE The status of the condition Complete: empty, True or False.

pk-metal rollout shows the plan and the state of each step.

A reboot of all nodes is a rollout that you write. metal/config/samples/rollout-reboot.yaml is an example.