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.
Synopsis
Section titled “Synopsis”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.
| Flag | Default | Description |
|---|---|---|
--delete-emptydir-data | false | Also evict pods with emptyDir volumes, whose data is lost. |
--drain-timeout<duration> | 15m0s | How long the drain may wait for pods to leave (30s..24h). |
--grace-period<int> | -1 | Seconds each evicted pod gets to stop; -1 keeps each pod's own. |
--mode<string> | default | How 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.
What it does
Section titled “What it does”- The command asks the API server for your user name.
- It reads the TalosNode and finds the Host that runs it.
- It makes a HostOperation with the reason
Rebootin the namespacepk-metal. You are the proposer. - The operation waits for approval. You can approve it yourself only if your site allows self-approval.
The plan
Section titled “The plan”| 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. |
Guards
Section titled “Guards”- 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. emptyDirdata- A pod with
emptyDirdata fails the drain, unless you give--delete-emptydir-data. With the flag, the pods lose that data.
Examples
Section titled “Examples”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.
pk-metal reboot --drain-timeout 30m --grace-period 60 cp-2Do a cold start, for example after a firmware change.
pk-metal reboot --mode powercycle --delete-emptydir-data w-1Objects
Section titled “Objects”| 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. |
Exit status
Section titled “Exit status”Related
Section titled “Related”- pk-metal approve lets the operation run.
- pk-metal abort removes the proposal or stops the reboot.
- pk-metal rollout reboots all nodes of a cluster, one at a time.
- Reboot a node
- HostOperation controller