Skip to content

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.

pk-metal upgrade [--wait 2m] talos|kubernetes <cluster> <version>
talos or kubernetes
What to upgrade.
<cluster>
The name of the TalosCluster.
<version>
The new version, in the form v1.2.3.
FlagDefaultDescription
--wait<duration>2m0sHow long to wait for the proposed rollout (0: do not wait).

This command also accepts the global flags --kubeconfig and --context.

  1. The command reads the TalosCluster.
  2. 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.
  3. It writes the version into spec.talosVersion or spec.kubernetesVersion.
  4. It waits for the rollout, at most the time of --wait.
  5. 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.

pk-metal upgrade
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.

Terminal window
pk-metal upgrade kubernetes lab v1.36.3
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.

CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".

The command gives code 1 if no rollout has a plan when the time of --wait ends. The version in the spec stays.