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.
At a glance
Section titled “At a glance”- Group and version
os.platform-kit.org/v1alpha1- Scope
- Cluster.
- Written by
- The Rollout proposer, or you for a
Reboot. The approver writesspec.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
Kinds of rollout
Section titled “Kinds of 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.
The plan
Section titled “The plan”Before the approval, the operator writes the plan to status.plan on each pass:
- Control planes, one at a time. The etcd leader goes last, so etcd elects a new leader only one time.
- For a
KubernetesUpgrade: oneKubeProxystep that moves the kube-proxy DaemonSet to the new image. - Workers, at most
spec.maxUnavailableWorkersat 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* → uncordondrain 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
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.7Propose. 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.7Approve 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-1a2b3c4dFirst control plane. The operator creates one HostOperation for cp-1. It carries rolloutRef and needs no approval of its own.
drain → talosUpgrade → waitNodeReady → waitEtcdHealthy → uncordonPause 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-1a2b3c4dHealth 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.
The leader goes last. cp-3 leads etcd. It is the last control plane, so etcd elects a new leader only one time.
Workers, two at a time. With spec.maxUnavailableWorkers: 2, two workers change at the same time. Control planes always go one at a time.
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
planHashthat 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, reasonPlanChanged. Nothing runs. - Pause after the first node. The rollout always stops after the first node. pk-metal rollout
resumesetsos.platform-kit.org/resumeto 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 areSkipped.
Approval rules
Section titled “Approval rules”A ValidatingAdmissionPolicy enforces the same rules as for a HostOperation:
- The creator must name themselves in
spec.proposedBy. - The approver is a person, never the operator. The approver is not the proposer if the site sets
selfApproval: Forbidden. approvedByandplanHashare 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
| Field | Type | Description |
|---|---|---|
abort | boolean | Abort 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. |
approval | object | Approval is the one human gate of the whole rollout.
|
approvedBy | string | ApprovedBy 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. |
planHash | string | PlanHash 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. |
clusterRefrequired | object | ClusterRef names the TalosCluster whose nodes this rollout changes. |
namerequired | string | The name of the object. |
drainTimeoutSeconds | integer (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. |
kindrequired | string | Kind is what changes on each node.ConfigTalosUpgradeKubernetesUpgradeReboot |
maxUnavailableWorkers | integer (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. |
nodes | []string | Nodes limits the rollout to these TalosNodes. Empty means every node of the cluster that needs the change. |
paused | boolean | Paused stops the rollout from starting another node. A node already in the middle of its change finishes it. Set and clear it at will. |
proposedByrequired | string | ProposedBy 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). |
requestedBy | []string | RequestedBy 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. |
target | object | Target 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. |
kubernetesVersion | string | KubernetesVersion is the Kubernetes release of a KubernetesUpgrade. |
talosVersion | string | TalosVersion is the Talos release of a TalosUpgrade. |
Status
Section titled “Status”| Field | Type | Description |
|---|---|---|
conditions | []object | Conditions: Planned, Approved, Progressing, Paused, Complete. |
plan | []object | Plan 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 | []string | Actions are the HostOperation action keys this step runs, in order, for the approver to read. |
configDigest | string | |
configSecret | string | ConfigSecret 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. |
from | string | From 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. |
host | string | |
image | string | Image is the installer image of a TalosUpgrade, pinned by digest, or the kube-proxy image of a KubeProxy step. |
kindrequired | string | Kind is Node (one node through a HostOperation) or KubeProxy.NodeKubeProxy |
node | string | Node is the TalosNode; Host the Host that runs it. Empty for a KubeProxy step. |
rebootRequired | boolean | RebootRequired: 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. |
role | string | Role is the node's role; control planes go one at a time.controlplaneworker |
to | string | |
planHash | string | PlanHash is sha256 over the kind, cluster, target and plan: what an approval names, and what every HostOperation of the rollout carries. |
steps | []object | Steps is the progress of each plan entry, by index. |
finishedAt | string (date-time) | |
message | string | Message says why a step failed or what it waits for. |
operation | string | Operation is the HostOperation (namespace/name) running a Node step. |
startedAt | string (date-time) | |
staterequired | string | State is Pending, Running, Succeeded, Failed or Skipped.PendingRunningSucceededFailedSkipped |
Columns of kubectl get talosrollouts (the columns marked wide show only with -o wide):
| Column | Value |
|---|---|
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 |
Conditions
Section titled “Conditions”| 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.
Example
Section titled “Example”$ pk-metal upgrade talos lab v1.14.7$ kubectl get talosrolloutsNAME CLUSTER KIND APPROVED PROGRESS COMPLETE AGElab-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.