Healthchecks gate Talos Linux version upgrades only. They do not gate Kubernetes upgrades or configuration changes.
Prerequisites
Before you get started, you must have the following:- An Omni account with permission to manage clusters.
omnictlinstalled and configured. See Install and configure omnictl.- A cluster managed by a cluster template.
How healthcheck gating works
When you upgrade Talos Linux on a cluster that defines healthchecks, Omni evaluates every healthcheck before it lets the next node upgrade:- Omni creates each healthcheck’s Job in the workload cluster and waits for it to finish.
- While any Job is still running or has failed, Omni holds the upgrade by keeping the upgrade quota at zero, so no new node is taken down. It re-runs the checks on an interval until they pass.
- When a Job succeeds (exits
0), Omni deletes it and lets the upgrade proceed. - When a Job fails, Omni surfaces the failure reason in the cluster’s Talos upgrade status and re-creates the Job to retry on the next interval.
Each check is re-evaluated on its
interval (default 30s, minimum 5s). A failing check holds the upgrade at the shortest interval requested by any failing check.Define a healthcheck
Healthchecks are defined under thehealthchecks field of kubernetes in the Cluster document of a cluster template.
Each entry defines a single Kubernetes Job, supplied either inline with job or from an external file with file.
Omni owns the Job’s identity so that it can track, recreate, and clean up the Job. It sets the Job’s name and adds its own labels and annotations, but everything else, including the namespace, service account, containers, and command, is yours.
If the Job manifest does not set a namespace, the Job runs in the
default namespace.
Inline healthcheck
Usejob to embed the Job manifest directly in the cluster template:
External file healthcheck
Usefile to reference an external YAML file containing the Job manifest.
The file path is relative to the working directory when running omnictl.
Return failure details to the upgrade status
When a healthcheck Job fails, Omni surfaces the failed container’s output as the failure reason in the cluster’s Talos upgrade status. By default, Omni captures the tail of the container’s output (itsstderr and stdout) on a non-zero exit, so anything your check writes before exiting becomes the message shown in Omni.
To make failures report a clear, human-readable reason:
- Set
backoffLimit: 0andrestartPolicy: Neverso a single failed run reports the failure promptly instead of being retried inside the Job. - Write a useful message to
stderrbefore exiting non-zero.
The failure reason shown in the upgrade status is truncated to 256 characters, so keep the most important detail first.
A complete example: gate upgrades on a healthy Ceph cluster
A common use case is to avoid taking a node down while a storage system is unhealthy. This example gates Talos upgrades on a healthy Rook Ceph cluster: the upgrade is held while Ceph is notHEALTH_OK, for example while placement groups are still rebalancing after the previous node rebooted.
The healthcheck Job only defines the check itself. Anything the check depends on, such as a service account and the RBAC it needs to read the Rook-managed connection details, is defined separately as Kubernetes manifests in the same cluster template file.
The supporting manifests must reconcile before the check can pass. Define them in the same template so that the service account and RBAC exist by the time Omni runs the Job.
Apply the cluster template
Once the cluster template defines your healthchecks, apply it usingomnictl:
Check healthcheck status during an upgrade
While an upgrade is held by a failing healthcheck, the reason is reported in the cluster’sTalosUpgradeStatus resource.
To inspect it, run the following command, replacing <cluster-name> with the name of your cluster:
step shows a message such as waiting for healthchecks to pass: "ceph-health": ceph is not healthy, holding upgrade: ..., including the output your check wrote to stderr.
Limitations
Here are some limitations with using healthchecks:- Healthchecks gate Talos Linux version upgrades only. They do not gate Kubernetes upgrades or configuration changes.
- The healthcheck manifest must be a Kubernetes Job (
kind: Job). - Only the Job is defined in a healthcheck. Any supporting resources, such as service accounts, RBAC, or config maps, must be defined separately as Kubernetes manifests in the same cluster template.
- The failure reason surfaced in the upgrade status is truncated to 256 characters.
- Healthchecks are not visible or manageable from the Omni UI at this time.