Operations and alerting
This page answers the on-call questions: what should page me, what happens when the database goes away, and how do I run this with the availability I need.
Probes
| Endpoint | What it checks | Used as |
|---|---|---|
/healthz | Nothing beyond the process being up — it always answers 200. A live process with a dead dependency is a readiness problem, not a liveness one. | Liveness probe (initial delay 10s, period 20s) |
/readyz | For an operator replica: the server answers and its serving certificate is loaded. The database is not part of it: with the database unreachable the replica stays ready and keeps refusing by the static rules, and the body says ready (database unreachable: static policy rules decide). For the scanner: the database, with a 2-second timeout; unreachable → 503. | Readiness probe (initial delay 5s, period 10s) |
Both Deployments — operator and scanner — carry both probes. Rollouts, ArgoCD sync waves and helm --wait all key off readiness, so a deploy of Attestkeep itself does not report healthy until it can actually decide.
What a database outage does — and does not do
The verdict store and scan queue live in PostgreSQL, so with the database gone the operator cannot decide. What happens next is deliberate, and we have run it, not reasoned about it:
- Operator replicas stay in the Service and keep answering. Each review gives its database work two seconds in all, and the whole review ends at three quarters of the timeout the API server states on the call (11.25 seconds with the chart's
webhook.timeoutSecondsof 15); after that the static rules —:latest, the registry allow-list, a required digest — decide, and verdicts that need the scan record degrade perwebhook.failurePolicy. Notifications are sent off the request; while the database cannot be read they queue up to 64 and the rest are dropped, counted inattestkeep_notifications_dropped_total. Nothing restarts; it all comes back with the database. - A decision whose record cannot be written is held in the replica that made it, at most 5,000 decisions and 16 MiB, and written to the admission ledger when the database answers, with its decision time and marked as recorded late. The replica logs
the database cannot be reached; admission decisions are held in this replica until it canonce, and when its held decisions are written, one line,admission decisions whose records could not be written when they were made, with how many it held, recorded late and could not record. Decisions dropped because the queue was full, refused by the database, or still held when the process stopped are counted in that account (admission_backlogs, and the evidence package'savailability.late_recording); a replica that dies takes what it held with it. - A pod the webhook could not record is not silent either: on recovery the operator finds the heartbeat gap and writes it to the outage record, and the next reconciliation sweep names every digest that entered without a decision.
- Admission never fails closed because of the database alone: quota metering explicitly admits on a database error rather than blocking deploys, and a failed cache read falls back to a cold verification instead of a deny.
- Scanning stops with the database and resumes with it — the queue is in the database, so nothing is lost, only delayed.
If an unchecked window is unacceptable for you, set webhook.failurePolicy: Fail and read Admission for what that trades away. Evidence documents report the outage either way: the availability block lists every window with its start, end and cause, and continuous is true only under Fail with zero outages.
Availability of the pieces
| Component | Default | How to harden |
|---|---|---|
| Operator / webhook | 2 replicas, preferred anti-affinity across nodes, PodDisruptionBudget minAvailable: 1 | Raise replicaCount; the replicas serialise controller work through a PostgreSQL advisory lock, so scaling out is safe. |
| Scanner | 1 replica, Recreate strategy | Raise scanner.replicas — the chart refuses the combination of multiple replicas and a ReadWriteOnce cache volume, and tells you why. |
| Chart-managed PostgreSQL | Single replica by design — it is a convenience, not an HA database | Point externalDsn (or externalDsnExistingSecret) at the PostgreSQL you already operate with replication and backups. The chart-managed StatefulSet then does not render at all. |
What should page you
Metrics are served on port 9090 at /metrics, exposed through the chart's Service. Series for every label combination exist from startup at zero, so absence of data is distinguishable from absence of denials.
| Condition | Signal | Why it matters |
|---|---|---|
| Admission is being bypassed | attestkeep_webhook_distrusted == 1 | The operator dials its own webhook through the CA bundle published on the ValidatingWebhookConfiguration, exactly as the API server would. While this gauge is 1 under failurePolicy: Ignore, deployments are proceeding unchecked — the one failure mode that otherwise looks like a quiet cluster. This is the alert to treat as a page, not a ticket. |
| Something got in | attestkeep_runtime_unmatched_digests > 0 | The reconciliation sweep found running digests with no allowed admission behind them — side-loaded images, or arrivals during an outage window. Also raised as the unverified_workload notification, once per newly seen digest. |
| Database trouble | attestkeep_database_up 0, the health page's Database line | Operator replicas stay ready through a database outage, so readiness is not the signal: alert on attestkeep_database_up == 0. The scanner does turn unready. |
| Admission records waiting or lost | attestkeep_admission_late_queue above 0; attestkeep_admission_late_records_total{outcome="dropped_full"|"dropped_rejected"|"lost_shutdown"} rising | The queue gauge is how many decisions a replica holds until the database answers; the dropped and lost outcomes are decisions that will not reach the ledger. The counter's series appear once a replica has held a decision, not at startup. |
| No controller leader | attestkeep_controller_leader_heartbeat_age_seconds above 120 for a few minutes | Seconds since the leader last stamped its heartbeat (every 30 seconds, database clock), exported by every replica that runs the controller, not by the scanner. While it grows, certificate renewal, SIEM delivery, licence renewal and the other periodic work are not running. |
| Ledger seal held back | attestkeep_ledger_seal_skipped_total rising | A write transaction left open on admissions keeps the seal from taking its lock; after ten skipped passes in a row the operator logs a warning, and the unsealed tail grows until the transaction ends. |
| Scanning is falling behind | attestkeep_scan_queue_depth sustained high; attestkeep_scans_failed_total rate vs attestkeep_scans_completed_total | First-day queues on a large cluster drain over hours; a queue that only grows means the scanner cannot reach a registry or its database. |
| Vulnerability data going stale | attestkeep_vulnerability_db_age_seconds | Verdicts are only as fresh as the database behind them. The trivy_db_failed notification fires on failed updates. |
| Licence quota approaching | attestkeep_image_quota{kind="count"} against {kind="limit"} | Exhaustion denies only image names never seen this period — running workloads keep running. threshold_80 / threshold_100 notification events fire at the boundaries. |
| Over the node ceiling | attestkeep_nodes{kind="count"} against {kind="ceiling"} (-1 = no ceiling); attestkeep_node_overage_seconds > 0 | The overage gauge is how long the cluster has been over its ceiling, 0 while within; alert on it well before 14 days (1,209,600 seconds), when image names never seen this period start being denied. Running workloads keep running, and those denials count under reason="quota". Notification events: nodes_80 (80 percent of the ceiling), nodes_over (over, with the date enforcement starts), nodes_enforced (the grace period ended still over) and nodes_cleared (back within, clock cleared). |
| Denials worth reviewing | attestkeep_admission_denials_total{reason=…} | Reasons are labelled: threshold, signature, tag, quota, unscanned and friends — a spike in one reason is a story, a spike across all of them is a policy change. |
Latency, if you watch it: attestkeep_admission_duration_seconds is a histogram labelled path="cached" or "cold" — the cached path is the one your rollouts feel. We do not publish latency numbers yet, because we have not measured them at a scale worth quoting; measure your own p99 from this series.
The outage record
Windows in which the control was not operating, or could not be shown to be operating, are recorded in the database (webhook_outages) and reported in every evidence document's availability block. These create an entry, all written when the operator can see again, with honest wording about what it cannot know:
- A webhook heartbeat gap of more than 45 seconds. Every webhook instance stamps a heartbeat while it serves admission, every 30 seconds; the window says either that no instance recorded serving (every instance was down, or the database was unreachable) or that this instance could not record serving (the database was unreachable, or the process was paused, stopped or cut off).
- A controller leader heartbeat gap of more than two minutes, for the time no other window covers: the periodic work did not run, and admission itself was not affected.
- A window in which the API server could not have verified the webhook against its published CA bundle — recorded from the moment distrust began to the moment the probe recovered.
There is no dedicated console page for outages yet; they surface in evidence documents and are queryable in the database. The live counterpart is the attestkeep_webhook_distrusted gauge above.
GitOps, ArgoCD, and who applies things
Enforcement sits at pod admission, so it does not matter who does the applying: kubectl, ArgoCD, Flux, a Job, an operator reconciling its CRD — every pod CREATE and UPDATE outside the bypass namespaces passes the same ValidatingWebhookConfiguration. There is nothing to integrate and no per-tool plugin: if your GitOps controller tries to sync a workload whose image fails policy, the sync fails with the denial message as the error, which is exactly where you want to read it.
Policies themselves are cluster-scoped CRDs and belong in git; Policies covers how console edits and git-managed policies coexist.