Skip to main content

Machine health checks and remediation

Syself Autopilot watches every node and replaces the ones that stop being healthy. Most of the time you do nothing.

Every node in a Syself Autopilot cluster runs a health daemon. The daemon continuously checks the node and reports problems as Kubernetes NodeConditions (flags on a Node object that describe its health state), events, and metrics.

What a condition does when it fires depends on the pool. A few conditions trigger automatic machine replacement; the rest are there for visibility and alerting.

What the health check watches 

Syself Autopilot watches each node's Ready state, the kubelet's summary of whether the node can still run pods. When a node reports itself broken, or stops reporting at all, for longer than a short grace period, it counts as unhealthy and remediation begins.

Every pool also watches NodeActivationFailed and BootEntryTampered. A node sets NodeActivationFailed when its own bring-up failed and it gave up after its retries, for example a control plane whose etcd member never came up. It sets BootEntryTampered when it booted with a kernel command line or boot files other than the ones sealed when it was provisioned. A control plane is also checked from the management cluster: if its etcd member does not become healthy after the node registers, the machine counts as unhealthy even while the node reports Ready.

On cloud pools, Syself Autopilot also acts on a few of its own health signals that mean the node is unlikely to recover on its own. Bare-metal pools are more conservative: a Ready failure, a failed bring-up, or a tampered boot entry triggers remediation, but the deeper health signals alert a person instead of reprovisioning the server, because a reinstall does not fix a hardware or storage fault, and the same fault can strike several servers at once.

See for what a node reports and how to alert on it.

The daemon and the replacement logic are separate. Keep them distinct.

The daemon reports. It detects a problem and writes it as a NodeCondition, an event, and a metric. That is all it does for most problems. It does not cordon, drain, or replace nodes. It does not set the Ready condition; the kubelet owns that.

Three things act on what it reports.

  • In-place repair restarts a broken unit (kubelet, containerd) on the node.
  • Syself's replacement logic reboots the node, and replaces it if the reboots do not help. It is the only automatic actor that deletes a node.
  • You, by alerting on a condition and deciding what to do. You can also force a replacement at any time: delete the Machine object, and the controllers drain the node and bring up a fresh one in its place.
Warning

Before you delete a control-plane Machine, check that etcd keeps its quorum without it. Deleting one while quorum is already at risk can leave the API server unable to accept changes. See .

Which conditions the replacement logic acts on, and how long each has to hold, is in What remediation does.

In-place repair 

Before anything heavier runs, a broken critical unit is restarted on the node.

kubelet: the health daemon probes /healthz every 10 seconds. On a failed probe it restarts kubelet.service and waits a 1-minute cooldown before trying again.

containerd: the daemon probes the CRI socket (CRI, the Container Runtime Interface, connects kubelet to the container runtime) every 10 seconds. On failure it restarts containerd.service with a 2-minute cooldown.

systemd also restarts these units on its own (Restart=always).

Every restart increments systemd's NRestarts counter for that unit.

When repair is not working. The service-not-recovering check runs every minute. For the critical units (kubelet, containerd, and on a worker the failover proxy), it sets ServiceNotRecovering = True when a unit is either in the systemd failed state, or flapping (its NRestarts went up by 3 or more since the last check). ServiceNotRecovering is one of the conditions you alert on yourself; see .

The daemon also exports syself_node_unit_restarts{unit} as a Prometheus metric, so you can see repair activity as a time series.

What remediation does 

What happens to an unhealthy node depends on its role and its infrastructure.

flowchart LR
  A["Node unhealthy past its window"]:::platform --> R{"Role"}:::decision
  R -->|Control plane| P1["Reboot, once on cloud, up to twice on bare metal"]:::platform
  R -->|Cloud worker| W1["Reboot once"]:::platform
  R -->|Bare-metal worker| B1["Reboot, up to twice"]:::platform
  P1 --> E{"Node recovers?"}:::decision
  W1 --> C{"Node recovers?"}:::decision
  B1 --> D{"Node recovers?"}:::decision
  E -->|Yes| S["Stays in the cluster"]:::platform
  C -->|Yes| S
  D -->|Yes| S
  E -->|No| CP["Replace, one at a time"]:::platform
  C -->|No| WR["Drain, then replace"]:::platform
  D -->|No| BR["Drain, retire the server, replace"]:::platform
  • Control planes get one reboot on cloud, with up to 180 seconds to come back, and up to two on bare metal, with up to 300 seconds each. A reboot keeps the disk and the etcd data, so a control plane that is overloaded or stuck recovers in place. If the node stays unhealthy, for example because its etcd member failed to join, the control-plane controller (KCP) removes the node's etcd member, deletes the machine and creates a new one. It replaces one control plane at a time and refuses any deletion that would cost etcd its quorum. On bare metal, the new machine takes a free host of the pool, often the same server after a reinstall.
  • Cloud workers get one reboot, with up to 180 seconds to come back. If the node stays unhealthy, the machine is drained and replaced with a new VM.
  • Bare-metal workers get up to two reboots, with up to 300 seconds each. If the node is still unhealthy after the last one, the server is retired: the machine is drained and deleted, and the server is kept out of the pool, so the next machine does not pick the same broken server. See Bring a retired server back.
Important

Once a cluster with a single control plane is up, that control plane is only rebooted, never replaced. Replacing it would take down etcd and the Kubernetes API, so if the reboots do not help, the unhealthy node stays and its conditions are yours to alert on. Run three control planes for production, as in .

Tip

The Ready=False window is long enough that a normal reboot or a short network blip resolves before Syself Autopilot notices. If your planned work (a firmware update, a manual reboot, hardware swap) takes longer than that, pause the Machine first, or Syself Autopilot starts remediating a node you are already fixing. The exact windows are in the tables below.

Cloud control planes 

Watched condition Unhealthy when Must hold for Then
Ready Unknown 600s reboot, then replace
Ready False 300s reboot, then replace
ReadonlyFilesystem True 120s reboot, then replace
KernelDeadlock True 120s reboot, then replace
ServiceNotRecovering True 60s reboot, then replace
NodeActivationFailed True 60s reboot, then replace
BootEntryTampered True 60s reboot, then replace
EtcdMemberHealthy (*) False 1200s reboot, then replace

(*) EtcdMemberHealthy is a condition on the control-plane Machine in the management cluster, not on the Node. It turns False when the node registers and True once its etcd member is healthy, normally within about 90 seconds. The 20-minute window leaves room for the node's own etcd join retries, so a node that is still trying is not replaced under it.

On a control plane with class: hcloud, VerityCorruption alerts instead of triggering a replacement. On cloud workers it triggers one.

Cloud workers 

Watched condition Unhealthy when Must hold for Then
Ready Unknown 600s reboot, then replace
Ready False 300s reboot, then replace
ReadonlyFilesystem True 120s reboot, then replace
KernelDeadlock True 120s reboot, then replace
ServiceNotRecovering True 60s reboot, then replace
VerityCorruption True 60s reboot, then replace
NodeActivationFailed True 60s reboot, then replace
BootEntryTampered True 60s reboot, then replace

Bare-metal control planes 

Watched condition Unhealthy when Must hold for Then
Ready False 300s reboot (up to 2×), then replace
NodeActivationFailed True 60s reboot (up to 2×), then replace
BootEntryTampered True 60s reboot (up to 2×), then replace
EtcdMemberHealthy (*) False 1200s reboot (up to 2×), then replace

(*) A condition on the Machine, as on cloud control planes.

Bare-metal workers 

Watched condition Unhealthy when Must hold for Then
Ready False 300s reboot (up to 2×), then retire
NodeActivationFailed True 60s reboot (up to 2×), then retire
BootEntryTampered True 60s reboot (up to 2×), then retire

On bare metal, Ready=Unknown alerts a human instead of triggering remediation. Ready=Unknown there can mean a network partition rather than a dead server.

Note

Automatic replacement on bare metal is deliberately narrow: only Ready=False, a failed bring-up, and a tampered boot entry trigger it. A tampered boot entry is the one daemon condition on this list, because it is not a hardware fault. Re-provisioning a physical server does not fix a bad disk or failing hardware, so the daemon's other conditions, VerityCorruption included, alert a human instead. On bare metal a corrupt OS image is as likely to come from failing storage as from tampering, and a reinstall onto that storage would fail again.

Bring a retired server back 

A retired bare-metal server stays out of the pool until you return it. Once you have fixed or replaced the hardware, remove the capi.syself.com/permanent-error annotation from its HetznerBareMetalHost in the management cluster:

				$ kubectl annotate hetznerbaremetalhost <host-name> -n <namespace> capi.syself.com/permanent-error-
			

The server is then free again, and a machine of the pool can claim it.

The platform stops before it makes things worse 

Remediation is bounded on purpose. Syself Autopilot only replaces nodes while the number of unhealthy machines in a pool stays small, and it never removes a control-plane node in a way that would cost etcd its quorum, the majority of control-plane members the cluster needs to stay writable. A node that is still booting is given time to settle before it counts against that limit at all.

The exact limits, per pool type:

Setting Control plane Cloud worker Bare-metal worker
Remediate only while this many are unhealthy ≤ 1 machine (an absolute count, not a percentage; it caps concurrent remediation. KCP separately refuses any deletion that would cost etcd quorum) [0-2] in the pool ≤ 1
nodeStartupTimeoutSeconds (grace for a booting node) 1800s 600s 1800s
Drain before delete (nodeDrainTimeoutSeconds) 180s 180s 1800s
Detach volumes before delete (nodeVolumeDetachTimeoutSeconds) 120s 120s 120s

The bare-metal worker drain waits 1800 seconds, as long as a new node may take to join. A bare-metal pool rolls without a spare node (maxSurge: 0), so while one server is reinstalled its pods have nowhere else in the pool to go. A shorter drain on the next node can give up while a PodDisruptionBudget still waits for the reinstalling node, and then a workload loses all its replicas. The cost: a PodDisruptionBudget that never allows an eviction holds the roll of a bare-metal pool for 30 minutes per node.

These values (the startup grace, the drain timeout, the volume-detach timeout, the concurrency gate, and the rollout maxSurge/maxUnavailable) are upstream Cluster API settings. The Cluster Stack ships them as tested defaults on the generated MachineDeployment and KubeadmControlPlane. To change the drain or volume-detach timeout, set it in the deletion block of a worker pool in your Cluster object, or under spec.topology.controlPlane.deletion, as in . Make sure you do not edit the generated objects directly, as the topology controller reverts manual changes on the next reconciliation.

Important

If more nodes go unhealthy than the limit allows, automatic replacement stops and waits for you. A fleet-wide problem should not trigger fleet-wide reprovisioning. That is your cue to take over: check the to see what is happening, pause remediation on any node you are working on, and fix the root cause before you let replacement resume.

Before a node is removed its pods are drained, and the drain respects PodDisruptionBudgets, so set one on any workload that must not lose too many replicas at once. See .

Self-healing does not repair hardware 

Remediation swaps a node out. It does not fix the physical machine underneath.

A retired bare-metal worker server is not picked again, so a hardware fault on it does not come straight back into the pool. The replacement machine needs another free host that the pool's host selector matches. If there is none, the new machine waits until you add a host or bring the retired one back.

A bare-metal control plane is not retired. Its replacement takes a free host of the pool, and when the host selector is narrow that is often the same server, wiped and reinstalled. A fault in the hardware itself then comes straight back.

Re-provisioning clears a software or filesystem problem. It does nothing for a failing disk, bad memory, or a dying NIC. A bare-metal worker with such a fault is retired automatically only if the fault trips the health check (Ready=False or a failed bring-up) and the node is still not Ready after both reboots. A fault that only raises a hardware condition, or that makes the node unreachable (Ready=Unknown), trips nothing on bare metal. Detect those faults directly:

  • Alert on the hardware-related . On bare metal these page a human rather than trigger a reboot, precisely because a reboot would not help.
  • Or run your own observability against the servers (SMART data, memory, temperature, link state) and alert from there.

When such an alert shows that a server is broken, take it out of the pool yourself: set maintenanceMode: true on its HetznerBareMetalHost (or remove it), and open a Hetzner support case for the hardware.

Pause remediation during maintenance 

When you plan to disrupt a node yourself (a firmware update, an in-place reboot, hardware work), pause remediation so Syself Autopilot does not mistake your maintenance for a failure. Pausing a Machine stops the management cluster from reconciling it at all, not only from remediating it.

Annotate the Machine 

In the management cluster:

				$ kubectl annotate machine <machine-name> -n <namespace> cluster.x-k8s.io/paused=true
			

Verify the annotation is set 

Before you start work, check the value:

				$ kubectl get machine <machine-name> -n <namespace> \
  -o jsonpath='{.metadata.annotations.cluster\.x-k8s\.io/paused}'
			

The output should be true.

Do your maintenance 

The Machine is not touched while it is paused, so do the firmware update, reboot, or hardware work now.

Remove the pause when you are done 

Remove the cluster.x-k8s.io/paused annotation so reconciliation resumes:

				$ kubectl patch machine <machine-name> -n <namespace> --type=json \
  -p='[{"op":"remove","path":"/metadata/annotations/cluster.x-k8s.io~1paused"}]'
			

Alternatively, run kubectl edit machine <machine-name> -n <namespace> and delete the annotation line manually.

Warning

Double-check the annotation for typos. If it is not set correctly, the node can be flagged unhealthy and reprovisioned while you work on it.

When remediation should not fire 

Pause first for anything that makes a healthy node look unhealthy on purpose: rebooting it, taking it off the network, or running long disruptive maintenance. Leave remediation on for everything else. A node that genuinely fails should be replaced, and that is the whole point of the system.

Turn off health checks for a pool 

On bare metal, remediation removes a node and its local data from the cluster. If reboots do not help, Syself Autopilot deletes the machine and retires the server. Some pools store data you cannot lose, such as . For these pools, you can turn off the health checks and handle failed nodes yourself.

Set this for the pool in your Cluster object:

yaml
				spec:
  topology:
    workers:
      machineDeployments:
        - name: <pool-name>
          healthCheck:
            enabled: false
			

Syself Autopilot then removes the health check for that pool. The nodes keep running. No rollout starts.

After that, nothing reboots or replaces a node in that pool on its own:

  • A failed node stays in the cluster until you delete its machine.
  • Maintenance mode on a host no longer deletes its machine. You delete it yourself.

Alert on the of that pool, so you notice failed nodes.

To turn the health checks back on, remove healthCheck from the pool.