Commit Graph
44 Commits
Author SHA1 Message Date
Thibault VINCENT 8bab222d43 fix(chart): require https scheme for monitor basicAuth 2026-08-05 19:14:52 +02:00
Thibault VINCENT 82e96e11a3 refactor(chart)!: rebuild PrometheusRule template, rename v3-era alerts
MAJOR CHANGE: PrometheusRule alert names and chart value keys
renamed. Users with AlertManager routing or silencing rules that
reference the old names must update them on upgrade. Migration map:

  X509ExporterReadErrors     -> SourceErrors (+ SourceErrorsSustained)
  alertOnReadErrors          -> alertOnSourceErrors
  readErrorsSeverity         -> sourceErrorsSeverity (+ ...SustainedSeverity)
  alertOnPassphraseFailures  -> alertOnKeystorePassphraseFailures
  passphraseFailuresSeverity -> keystorePassphraseFailuresSeverity
  alertOnCertificateErrors   -> alertOnCertificateError       (singular)
  certificateErrorsSeverity  -> certificateErrorSeverity      (singular)
  alertOnCertificateCollisions -> alertOnCertificateCollision (singular)
  certificateCollisionsSeverity -> certificateCollisionSeverity
  alertOnCRLs                -> (removed; CRL alerts always-on like Renewal/Expiration)

Substantive changes alongside the renames:

- SourceErrors gets the same two-band shape as KubeTransportErrors
  (warning at >5/15min for 5m, critical for 30m). The previous "fire
  on any single error" expression paged on a single malformed PEM,
  which was indistinguishable from a real outage.
- SourceErrors and KubeTransportErrors both aggregate over
  reason/resource via 'sum without (...)', so the alert routes by
  source. The breakdown stays available on the metric for triage.
- CRLNeedsRefresh and CRLStale no longer require alertOnCRLs — same
  policy as CertificateRenewal/Expiration. The underlying x509_crl_*
  series only exist when a CRL is actually observed, so installs that
  don't watch CRLs get nothing.
- CertificateRenewal expression now anchors to (not_after - now) > 0,
  so it doesn't keep firing alongside CertificateExpiration once a
  cert is past its NotAfter (those two alerts had identical truth
  values in the late-life window).
- CertificateExpiration description distinguishes 'expires in X' from
  'expired X ago' via humanizeDuration's sign, so the message stays
  accurate after the cert is past NotAfter.
- CertificateError, CertificateNotYetValid, CertificateRenewal and
  CertificateExpiration each get inline comments explaining their
  dependency or always-on status — consistent with the recent
  KubeTransportErrors / CertificateCollision additions.

Template hygiene:

- Three helper templates in _helpers.tpl: alertExtraLabels and
  alertExtraAnnotations (replace 12 duplicated if-blocks);
  alertLocationSuffix (replaces the 5 sites that re-emit the
  "{{if $labels.secret_name}}in Kubernetes secret …{{else}}at
  location …{{end}}" literal — when we flipped quotes to backticks
  recently, 5 edits were required; the helper would have made that
  one).
- All alerts stay in a single PrometheusRule group. Groups in
  PrometheusRule only matter for sequential recording-rule ordering,
  per-group evaluation intervals, or execution isolation — none of
  which apply here. AlertManager routes on labels (alertname,
  severity), not on group names, so splitting by domain would
  fragment without buying anything; worse, it would trap users who
  add recording rules via extraAlertGroups into the wrong group.
  Category-based routing on the consumer side is straightforward via
  alertname regex (Source.*, Cert.*, CRL.*, Kube.*).
2026-05-25 19:18:58 +02:00
Thibault VINCENT 52e9c2e66c feat: emit x509_kube_transport_errors_total for LIST/WATCH/informer failures
The Kubernetes source's transport layer had 9 distinct failure sites
that surfaced only as logs: LIST failure (with retry/backoff), WATCH
start failure, WATCH stream Error event, watch flap (close within 5s
of open), and namespace informer sync timeout — once for secrets, once
for configmaps. None had a corresponding metric, so an exporter that
was functionally up but operationally degraded (token rotation drift,
apiserver throttling, intermittent network) was invisible to ops.

Introduce x509_kube_transport_errors_total{source_name,resource,reason}
incremented at each of the 9 sites via a new Recorder interface on
k8s.Options. The interface keeps the source decoupled from
*registry.Registry; nil is valid (the unmetered path keeps the old
log-only behaviour) and tests plug a fake. main.go wires the actual
registry through.

Ship a paired KubeTransportErrors PrometheusRule alert (opt-in via
alertOnKubeTransportErrors, default true). docs/metrics.md documents
the new metric, the five reason codes, and cross-links the alert.
2026-05-25 19:18:58 +02:00
Thibault VINCENT 5291d5a989 feat: split collision counter metric into total + dropped
Detect-only x509_cert_collision_total ticks on every scrape under the
default CollisionAuto policy, even when the discriminator label
silently resolves the overlap and no certificate is dropped. Alerting
on it produced perma-firing pages for a benign config quirk.

Introduce x509_cert_collision_dropped_total: counts only the items
the registry actually threw away (CollisionNever policy). The
CertificateCollision PrometheusRule now points at the new counter so
the alert fires only when data is genuinely lost. The detect-only
counter stays available for dashboards and diagnostics.

Tests in pkg/registry cement the contract: dropped stays at 0 under
CollisionAuto and is positive under CollisionNever. docs/metrics.md
documents both counters and cross-links them.
2026-05-25 19:18:58 +02:00
Thibault VINCENT 0eed4da25d feat(chart, docs): expose jks.passphraseSecretRef in schema + examples 2026-05-15 16:54:25 +02:00
Thibault VINCENT a163963eeb docs(README, metrics): announce JKS/JCEKS support and x509_jks_passphrase_failures_total 2026-05-13 17:55:30 +02:00
Thibault VINCENT c6e9aecf02 docs(chart, metrics): document DER format and add a positive schema fixture 2026-05-13 16:57:02 +02:00
Thibault VINCENT 9b02f8f7d4 docs(metrics): describe the x509_crl_* family 2026-05-13 16:57:02 +02:00
Thibault VINCENT 7610ca68fe feat(cabundle): extend source to APIService and CRD conversion webhooks 2026-05-13 14:24:36 +02:00
Thibault VINCENT 86fb1c11b9 test+docs(cabundle): e2e scenarios, README + metrics.md, opt-in example 2026-05-13 14:24:36 +02:00
Thibault VINCENT ab1ce3ad77 feat(k8s): support shell-glob patterns in include/exclude names 2026-05-11 18:16:38 +02:00
Thibault VINCENT e4457ef2c3 feat(chart): drop privileged from hostPathsExporter securityContext defaults
fix #581
2026-05-07 12:21:34 +02:00
Thibault VINCENT 26c1a48c87 refactor(chart): consolidate pre-upgrade hooks into one task-oriented job 2026-05-07 12:21:34 +02:00
Thibault VINCENT 85134ca32a docs(migration): note hostPathsExporter keeps allowPrivilegeEscalation true 2026-05-06 14:49:11 +02:00
Thibault VINCENT 9b0c9757ca docs(migration): soften wording on chart OCI hybrid history 2026-05-06 13:41:39 +02:00
Thibault VINCENT e0f5f74622 docs(migration): clarify v3 chart was already OCI-backed hybrid 2026-05-06 13:37:38 +02:00
Thibault VINCENT 711c27dd77 feat(chart): switch default image.registry from docker.io to quay.io 2026-05-06 04:09:01 +02:00
Thibault VINCENT abbb9b5fa8 feat(chart): values.schema.json with strict mode + helm-side regression tests 2026-05-06 01:21:22 +02:00
Thibault VINCENT 14b17c79dc docs: align comments and documentation with direct LIST+WATCH architecture 2026-05-05 14:34:42 +02:00
Thibault VINCENT 2ee438dda2 refactor(k8s): replace SharedInformer with paginated direct LIST+WATCH 2026-05-05 14:17:17 +02:00
Thibault VINCENT eec8b95462 docs(assets): add chart logos 2026-05-04 14:46:10 +02:00
Thibault VINCENT 4600419e1d docs(v3-to-v4): drop the deprecation of our classical helm repo 2026-05-04 13:01:17 +02:00
Thibault VINCENT 6989b06299 docs(v3-to-v4): add note on v3 to v4 service ClusterIP migration 2026-05-04 04:03:42 +02:00
Thibault VINCENT 7a0d76bd95 build: switch to cosign v3 format
Not a problem, our v4 is still in alpha and no consumer is checking signatures
2026-05-04 00:27:32 +02:00
Thibault VINCENT c28eb69fda docs(metrics): new gates ; fixed labels ; better promql snippets ; cardinality clarification 2026-05-04 00:13:49 +02:00
Thibault VINCENT a719113cb8 feat!: add new metric gates, diags and not_before off by defaut, 2026-05-03 16:07:48 +02:00
Thibault VINCENT 3dd744b856 docs(v3-to-v4): clarify the deprecation of CLI flags 2026-05-03 15:48:17 +02:00
Thibault VINCENT aa8750399a docs(v3-to-v4): drop hallucinated content 2026-05-03 15:35:25 +02:00
Thibault VINCENT 5ef7b43913 feat(container)!: switch default variant from busybox to scratch (floating tags) 2026-05-02 16:51:32 +02:00
Thibault VINCENT 31a4e2875a build(release): switch SLSA-3 provenance to actions/attest-build-provenance 2026-05-02 14:35:38 +02:00
Thibault VINCENT 584ecdb351 docs(3to4): fix codeql warning on typescript syntax 2026-05-02 14:08:28 +02:00
Thibault VINCENT da6ba51d93 docs: add a v3 to v4 migration guide 2026-05-02 13:56:13 +02:00
Thibault VINCENT 297fd7489d docs(examples): add curated values.yaml starters for generic and per-distro setups 2026-05-02 13:55:30 +02:00
Thibault VINCENT c571198732 ci: pin actions with renovate only ; drop ratchet from the repo
They had incompatible styles.
2026-05-01 19:44:01 +02:00
Thibault VINCENT 0a7d655048 docs(assets): new alternative logo 2026-05-01 16:23:41 +02:00
Thibault VINCENT 30d1174718 docs(README): relocate hardening to a dedicated page ; add a menu 2026-05-01 02:12:28 +02:00
Thibault VINCENT d93d1879fc docs: add v3-to-v4 migration guide 2026-04-30 20:36:02 +02:00
Thibault VINCENT 9cbeb941ee docs: relocate grafana dashboard screenshot 2026-04-30 20:36:02 +02:00
Thibault VINCENT efe4de88a9 docs(README): add logo and refactor badges 2026-04-30 20:36:01 +02:00
Thibault VINCENT 6b5078cd06 docs: dedicated metrics reference under docs/ 2026-04-30 20:36:01 +02:00
Thibault VINCENT ba3bd51207 docs: new page with frequent questions 2026-04-30 20:36:00 +02:00
Thibault VINCENT 055c50270a doc: remove JSON for the Grafana dashboard
Upstream for the dashboard is now hosted at:
https://grafana.com/grafana/dashboards/13922
2021-02-19 20:39:39 +01:00
Thibault VINCENT fdee6b2bdc chore: project renamed to x509-certificate-exporter 2021-02-19 14:42:11 +01:00
Thibault VINCENT f09c7e03ff feat: add the Grafana dashboard
Cannot be uploaded to grafana.com at the moment
2021-02-18 19:15:29 +01:00