Files
claude-botandClaude Opus 5 39a9519ed3
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
fix(triage): give the CI diagnostics SA read access to Loki
The alert triage agents could reach Prometheus and Alertmanager through the
apiserver service proxy, but not Loki:

  kubectl auth can-i get "services/loki:3100" --subresource=proxy -n monitoring \
    --as=system:serviceaccount:monitoring:ci-diagnostics   -> no
  (same check for kube-prometheus-stack-prometheus:9090     -> yes)

That gap has a sharp edge. A KubeJobFailed-class alert can only be cleared by
DELETING the failed Job — the rule's own annotation instructs this — and the
deletion destroys the pod and its logs. So the agents would inspect a failed
Job, find no live pod, declare the root cause "unconfirmable", and then delete
the last copy of the evidence.

The evidence was never actually gone: Alloy ships all pod logs to Loki with
retention_period: 2160h (90d). Issue #380 declared velero/restore-test-29740440
"probably unconfirmable" and its full failure output was in Loki the whole time
(FAIL: 3 — apps restore phase + two PVC parity checks).

Adds `loki` / `loki:3100` to the existing service-proxy Role (read-only GET,
same bare + :port-qualified pattern the other entries use, verified against the
live Service which exposes http-metrics:3100), and teaches both agent prompts
the query recipe so "the pod is gone" stops being accepted as a dead end.

No new privilege class: the agents already hold pods/log cluster-wide. This
mainly extends their reach to *deleted* pods.

Refs #427, #380

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 21:21:38 +02:00
..