Skip to content

Command · pk-metal

pk-metal reboot

changes machinesneeds the cluster

pk-metal reboot proposes a clean reboot of one Talos node as a HostOperation. Nothing changes until a person approves the operation. Your site decides if that can be you.

pk-metal reboot [--mode default|powercycle] [--drain-timeout d] [--grace-period s] [--delete-emptydir-data] <node>
<node>
The name of the TalosNode. It is also the name of the Kubernetes node.
FlagDefaultDescription
--delete-emptydir-datafalseAlso evict pods with emptyDir volumes, whose data is lost.
--drain-timeout<duration>15m0sHow long the drain may wait for pods to leave (30s..24h).
--grace-period<int>-1Seconds each evicted pod gets to stop; -1 keeps each pod's own.
--mode<string>defaultHow the reboot ends: default (kexec or warm reboot) or powercycle (cold start, for firmware).

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

--grace-period is at most 3600 seconds.

  1. The command asks the API server for your user name.
  2. It reads the TalosNode and finds the Host that runs it.
  3. It makes a HostOperation with the reason Reboot in the namespace pk-metal. You are the proposer.
  4. The operation waits for approval. You can approve it yourself only if your site allows self-approval.
Step Action Effect
1 Cordon Kubernetes schedules no new pods on the node.
2 Drain Evicts the pods, so that each PodDisruptionBudget holds. DaemonSet pods and static pods stay.
3 TalosReboot Reboots the node through Talos. With --mode powercycle, a cold power cycle follows.
4 WaitNodeReady Waits until the node is ready in Talos and in Kubernetes.
5 WaitEtcdHealthy Control plane only. Waits until etcd is healthy again.
6 Uncordon Kubernetes schedules pods on the node again.
Control plane
The operator reboots it only while all other etcd members are healthy and no other control plane of the cluster is down. Until then, the approved operation waits with the block ClusterDisruption.
Drain
If a PodDisruptionBudget holds a pod, the drain waits for the time of --drain-timeout. Then the operation fails and the node stays cordoned.
emptyDir data
A pod with emptyDir data fails the drain, unless you give --delete-emptydir-data. With the flag, the pods lose that data.
pk-metal reboot
pk-metal reboot cp-2
proposed pk-metal/reboot-cp-2-m4q8z: a clean reboot of TalosNode cp-2 on host simhw2288v5000398 (6 steps).
Approve it after reading the plan (another person must, if the site forbids self-approval): pk-metal approve pk-metal/reboot-cp-2-m4q8z
It is a control plane of cluster lab: once approved, it waits until every other etcd member is healthy and no other control plane is down.
To withdraw it: pk-metal abort --reason "<reason>" pk-metal/reboot-cp-2-m4q8z

Give the pods more time, and let the drain wait longer.

Terminal window
pk-metal reboot --drain-timeout 30m --grace-period 60 cp-2

Do a cold start, for example after a firmware change.

Terminal window
pk-metal reboot --mode powercycle --delete-emptydir-data w-1
Object Access Purpose
SelfSubjectReview create Gets your user name from the API server.
TalosNode get Reads the role and the cluster of the node.
Host list Finds the machine that runs the node.
HostOperation create The proposal.
CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".