Command · pk-metal
pk-metal upgrade
changes machinesneeds the cluster
pk-metal upgrade changes the version in the spec of a TalosCluster.
Then it waits for the TalosRollout that the operator proposes, and prints its plan.
Nothing on a machine changes until a person approves that plan.
Synopsis
Section titled “Synopsis”pk-metal upgrade [--wait 2m] talos|kubernetes <cluster> <version>talosorkubernetes- What to upgrade.
<cluster>- The name of the TalosCluster.
<version>- The new version, in the form
v1.2.3.
| Flag | Default | Description |
|---|---|---|
--wait<duration> | 2m0s | How long to wait for the proposed rollout (0: do not wait). |
This command also accepts the global flags --kubeconfig and --context.
What it does
Section titled “What it does”- The command reads the TalosCluster.
- It examines the step. It refuses these steps and changes nothing:
- A version that is not in the form
v1.2.3. - A version that is older than the current one.
- A Talos upgrade from a release that Talos does not support as a source.
- A pair of Talos and Kubernetes versions that Talos does not support.
- A version that is not in the form
- It writes the version into
spec.talosVersionorspec.kubernetesVersion. - It waits for the rollout, at most the time of
--wait. - It prints the plan of the rollout and the command that approves it.
- Talos upgrade
- The operator drains each node, upgrades it with the installer for that version and reboots it. Control planes go first.
- Kubernetes upgrade
- Each node gets the new kubelet and the new control plane images. Then kube-proxy follows.
If the cluster already asks for the version, the command changes nothing and shows the rollout.
With --wait 0, the command does not wait for the rollout.
Examples
Section titled “Examples”pk-metal upgrade talos lab v1.14.7
cluster lab now asks for talos v1.14.7 (was v1.14.6); nothing on a machine changed yet
rollout lab-talosupgrade-1a2b3c4d: TalosUpgrade on cluster lab to Talos v1.14.7
proposed by system:serviceaccount:pk-metal:pk-metal
state AwaitingApproval
plan sha256:5b0c9e41a7d2…: control planes one at a time, then up to 1 worker(s) at once; it pauses after the first node
1. cp-1 (controlplane, host simhw2288v5000397): v1.14.6 -> v1.14.7, REBOOTS
2. cp-2 (controlplane, host simhw2288v5000398): v1.14.6 -> v1.14.7, REBOOTS
3. cp-3 (controlplane, host simhw2288v5000399): v1.14.6 -> v1.14.7, REBOOTS
4. w-1 (worker, host simhw2288v5000400): v1.14.6 -> v1.14.7, REBOOTS
5. w-2 (worker, host simhw2288v5000401): v1.14.6 -> v1.14.7, REBOOTS
Nothing runs until someone approves it: pk-metal rollout approve lab-talosupgrade-1a2b3c4d
Upgrade Kubernetes.
pk-metal upgrade kubernetes lab v1.36.3Objects
Section titled “Objects”| Object | Access | Purpose |
|---|---|---|
| TalosCluster | get, patch | Writes the version. The patch carries the UID and the resource version of the object that the command read. |
| TalosRollout | list | Finds the rollout that the operator proposes for the version. |
If you keep the TalosCluster in git, change the version there. The command and git must not disagree.
Exit status
Section titled “Exit status”The command gives code 1 if no rollout has a plan when the time of --wait ends. The version in the spec stays.
Related
Section titled “Related”- pk-metal rollout approves the rollout and continues it after the pause.
- Upgrade Talos
- Day-2 change
- TalosCluster controller and TalosRollout controller