monitoring

VirtPlatformAutopilotTombstoneStuck

Meaning

This alert fires when virt-platform-autopilot cannot remove a resource it is trying to delete (a “tombstone”) for more than 30 minutes, either because deletion failed (-1) or because the resource lacks the required management label (-2).

The alert is driven by the kubevirt_autopilot_tombstone_status gauge, labelled by kind, name, and namespace:

The alert triggers on kubevirt_autopilot_tombstone_status < 0 held for 30m.

Impact

This is a warning alert. The impact depends on the firing condition:

Diagnosis

  1. Export the NAMESPACE environment variable:

    $ NAMESPACE="$(kubectl get deployment -A -l app=virt-platform-autopilot \
        -o jsonpath='{.items[*].metadata.namespace}')"
    $ [ "$(echo "$NAMESPACE" | wc -w)" -eq 1 ] || \
        { echo "Error: expected 1 deployment, found in: ${NAMESPACE:-none}"; exit 1; }
    $ export NAMESPACE
    
  2. Read the kind, name, and namespace from the alert labels, and note the metric value: -1 (deletion error) or -2 (label mismatch).

  3. For a deletion error (-1), check what is blocking removal as stuck finalizers, an in-progress deletion, RBAC, and the operator logs:

    $ kubectl get <kind> <name> -n <namespace> \
        -o jsonpath='{.metadata.finalizers} {.metadata.deletionTimestamp}'
    $ kubectl auth can-i get <resource-type> -n <namespace> \
        --as system:serviceaccount:$NAMESPACE:virt-platform-autopilot
    $ kubectl auth can-i delete <resource-type> -n <namespace> \
        --as system:serviceaccount:$NAMESPACE:virt-platform-autopilot
    $ kubectl -n $NAMESPACE logs --tail=200 \
        -l app=virt-platform-autopilot | grep -i tombstone
    

    Replace <resource-type> with the lowercased, pluralized form of <kind> (e.g., services, configmaps). For CRDs, use the format shown by kubectl api-resources (e.g., kubedeschedulers, machineconfigs). Omit -n <namespace> for cluster-scoped resources like KubeDescheduler or MachineConfig.

  4. For a label mismatch (-2), confirm the resource lacks the management label. This is the safety check working as intended: the operator refuses to delete a resource it did not create. Omit -n <namespace> for cluster-scoped resources like KubeDescheduler or MachineConfig.

    $ kubectl get <kind> <name> -n <namespace> \
        -o jsonpath='{.metadata.labels.platform\.kubevirt\.io/managed-by}'
    

Mitigation

The for: 30m clause only delays firing; it does not delay resolution. The alert clears on the next evaluation after the expression becomes false, that is, once kubevirt_autopilot_tombstone_status is no longer negative (the resource is deleted or the CRD is absent, 0, or exists again, 1).

If you cannot resolve the issue, see the following resources: