Day 2
Monitor the fleet
See what runs, what waits and what is wrong, from a quick look to a page.
Three ways to look
Section titled “Three ways to look”| Tool | For | Reads |
|---|---|---|
| pk-metal status | A quick look, a cron check | The management cluster |
| pk-metal top | A live view, one tile for each machine | The management cluster |
| Prometheus metrics and alerts | Dashboards and pages | The /metrics endpoint of the manager |
Use pk-metal status in a check
Section titled “Use pk-metal status in a check”-
Run the command and read its exit status.
Terminal window pk-metal status; echo "exit=$?" -
Read the result.
Exit Meaning 0Nothing needs a person. 1The command could not read the cluster. 2Something needs a person: an approval, a failure, an unhealthy etcd, a stale backup, a node that is not Ready. A rollout that waits for approval or a resume also counts. -
For a script, use the JSON form.
Terminal window pk-metal status -o json
Start the alerts
Section titled “Start the alerts”-
Make sure that the cluster has the Prometheus Operator. The files use its kinds
PrometheusRuleandServiceMonitor. -
Open
metal/config/prometheus/metrics_reader.yaml. Set the subject of theClusterRoleBindingto the service account of your Prometheus.The manager serves
/metricsover HTTPS. It answers only a caller whose token maygetthe URL/metrics. -
If your Prometheus selects ServiceMonitors by a label, add that label to
metal/config/prometheus/servicemonitor.yaml. -
Apply the rules, the ServiceMonitor and the role.
Terminal window kubectl apply -k metal/config/prometheus -
Make sure that Prometheus scrapes the manager. In Prometheus, this query gives
1.up{job="pk-metal-metrics", namespace="pk-metal"}
Each alert has a runbook_url annotation. It links to the runbook.
| Alert | Fires when | Runbook |
|---|---|---|
PkMetalMetricsAbsent |
Prometheus did not scrape the manager, for 10 minutes | Management cluster lost |
PkMetalAdmissionGateDegraded |
An admission policy of the approval gate, or its binding, is missing or does not deny, for 2 minutes | Admission gate degraded |
PkMetalOperationFailed |
An operation failed, for 5 minutes | Operation failed |
PkMetalOperationStuck |
An operation is in one step for more than 2 hours | Operation stuck |
PkMetalOperationBlocked |
An approved operation did not start for 1 hour, and no window or queue holds it | Operation held |
PkMetalApprovalWaiting |
An operation waits more than one day for approval | Operation held |
PkMetalBMCUnreachable |
A BMC does not answer, for 15 minutes | BMC unreachable |
PkMetalNodeNotReady |
A node that answered before is not Ready, for 15 minutes |
Node not ready |
PkMetalClusterUnavailable |
A bootstrapped cluster is not available, for 15 minutes | Cluster unavailable |
PkMetalEtcdBackupStale |
The newest verified backup is older than two backup intervals | Backup failing |
PkMetalEtcdBackupMissing |
A backup policy has no verified snapshot after 1 hour | Backup failing |
PkMetalCredentialsExpiring |
A published credential has less than one sixth of its lifetime left | Credentials not renewed |
PkMetalRolloutStalled |
A rollout waits for health, cannot plan, or waits after its first node, for 1 hour | Rollout paused or plan changed |
PkMetalRolloutFailed |
A rollout ended without finishing | Rollout paused or plan changed |
To limit who can connect to the manager pod, edit and apply metal/config/manager/networkpolicy.yaml. It is not part of the base install. Only you know the BMC and Prometheus addresses of your site.
To check the rules with promtool, run mise run metrics:rules.
Important metrics
Section titled “Important metrics”All names start with pk_metal_.
host_phase,host_blocked- The phase of each Host, and the reason when it waits.
operation_failed,operation_awaiting_approval_seconds,operation_blocked- Operations that need a person, and approved operations that did not start.
operation_running_seconds- How long a running operation is in its current step, with the step.
bmc_reachable- 1 when the BMC answers Redfish.
talosnode_ready,taloscluster_available- Node and cluster health.
talosnode_expected_ready,taloscluster_expected_available- 1 when the node or cluster must be healthy: the same rule as pk-metal status. The alerts use them, so an install does not page.
etcd_backup_last_success_timestamp_seconds,etcd_backup_interval_seconds- The time of the newest verified snapshot, and the shortest interval of the backup policies of the cluster.
rollout_condition- 1 for each rollout that did not succeed, with the reason where it stands.
rollout_nodes_done,rollout_nodes_total- The progress of each rollout.
admission_gate_degraded- 1 for each admission policy of the approval gate that is missing or does not deny. See Admission policies.
Related
Section titled “Related”- Collect diagnostics
- mise run lab:observe checks the tables and the metrics in the lab.
- Runbooks