Skip to content

Runbook

Management cluster lost

pk-metal status
Exit status 1. The management cluster does not answer.
The Talos nodes of the management cluster
They answer, but etcd does not run or has no quorum.
Alert
PkMetalMetricsAbsent: Prometheus did not scrape the manager for 10 minutes. No other pk-metal alert can fire then.

PkMetalMetricsAbsent also fires when only the manager stopped. Find the case before you change anything.

  1. Ask the API server of the management cluster.

    Terminal window
    kubectl -n pk-metal get pods,endpoints
  2. Read the result.

    Result Case What to do
    The API server does not answer You lost the management cluster Continue with Fix.
    The manager pod is not Running The manager stopped Read its log: kubectl -n pk-metal logs deploy/pk-metal-manager --previous.
    The pod runs, the Service has no endpoints The pod is not ready kubectl -n pk-metal describe pod -l app.kubernetes.io/component=manager.
    The pod runs and has endpoints Prometheus cannot scrape it Check the ServiceMonitor and the metrics reader role. See Monitor the fleet.

The operator, its records and its view of the machines are gone. The workload clusters continue to run. Only the snapshots in the S3 bucket hold the old state.

  1. Start kind on a workstation and install the operator, as for a new site.

  2. Add the restore mark to the TalosCluster before you apply it. Then the operator in kind does not bootstrap an empty cluster.

    metadata:
    name: mgmt
    annotations:
    os.platform-kit.org/restore-pending: "true"
  3. Apply the objects from git.

  4. Download the newest snapshot from the bucket with your S3 client. Decrypt it.

    Terminal window
    pk-metal backup decrypt --in mgmt.db.age --identity ~/.config/age/keys.txt -o mgmt.db
  5. On each control plane that still runs etcd, wipe its etcd data.

    Terminal window
    talosctl -n 192.0.2.12 reset --graceful=false --reboot --system-labels-to-wipe=EPHEMERAL
  6. On one control plane, start etcd from the snapshot.

    Terminal window
    talosctl -n 192.0.2.11 bootstrap --recover-from=./mgmt.db
  7. Delete the plain snapshot.

    Terminal window
    rm mgmt.db
  8. When the cluster shows Bootstrapped=True, remove the mark.

    Terminal window
    kubectl annotate taloscluster mgmt os.platform-kit.org/restore-pending-
  9. Scale the operator in kind to zero.

  10. Make sure that the operator in the restored cluster runs.

pk-metal --kubeconfig mgmt.kubeconfig status shows the fleet as it was at the snapshot time.