Repository navigation
Description
Context & Rationale
The repo defines no CoreDNS scrape:
- k8s/coredns/ only sets resource limits.
- Alloy's
clusterMetrics.kubeDNSis off by default (cached k8s-monitoring 4.5.2), and k8s/monitoring/k8s-monitoring-values.yaml:18-40 doesn't turn it on.
Whether CoreDNS is scraped anyway is unknown:
- The server's
kubernetes-service-endpointsjob is on (prometheus-values.yaml:60-64). It scrapes any Service annotatedprometheus.io/scrape, and k3s'skube-dnsService may carry that annotation for port 9153 (unverified). - If the monitoring NetworkPolicy is applied, its kube-system egress allows only ports 53, 443, 6443, 8443, 9100 and 10250 (k8s/monitoring/networkpolicy.yaml:58-90), which would block 9153. deploy-stack doesn't apply that policy (stack_lifecycle.py:130-145, 740).
In-cluster DNS failures, such as NXDOMAIN or SERVFAIL bursts and slow upstreams, may be invisible today.
Scope & Deliverables
- Deliverable:
- First, on the homelab, run
devops prometheus query 'up{service="kube-dns"}'anddevops prometheus query 'sum(rate(coredns_dns_requests_total[5m]))', and record the results. - Make exactly one scrape path explicit and allowed (see the key question), and allow monitoring egress to kube-system:9153.
- Add a CoreDNS dashboard built over captured
coredns_*series:- requests by type and protocol;
- responses by rcode;
- request duration p50/p95/p99;
- cache hits and misses;
- forward request duration.
- Add a CoreDNS capture to feat(k8s): llm gateway, otel collector and prometheus dashboards over metrics the cluster collects (
k8s/monitoring/dashboards/) #693's dashboard test.
- First, on the homelab, run
- Acceptance criteria:
- The chosen scrape job's
upseries reads 1 throughdevops prometheus query, andsum(rate(coredns_dns_requests_total[5m]))returns a value. - Every panel returns data on the homelab.
- The dashboard test covers the CoreDNS names and labels.
- The chosen scrape job's
- Key questions: Which scrape path? (proposed) If the server already scrapes kube-dns, keep that job and only open egress on 9153. Otherwise, enable Alloy's
clusterMetrics.kubeDNS. Never enable both, to avoid duplicate series. - Constraint: Tests never touch the network.
Strategic Alignment
- Milestone: Backlog
- Depends on: feat(k8s): llm gateway, otel collector and prometheus dashboards over metrics the cluster collects (
k8s/monitoring/dashboards/) #693 (shared dashboard metric test)
Monitoring cleanup amendment (2026-10-03)
Answer to the open question (checked 2026-10-03). The Prometheus server's kubernetes-service-endpoints job already scrapes kube-system/kube-dns:9153. It is that job's only active target. #1130 disables the job and turns on clusterMetrics.kubeDNS in the same change, so CoreDNS is never scraped twice, and it adds the monitoring egress rule for kube-system 9153 that the Alloy collector then needs.
After #1130, this item's remaining scope is the dashboard (and any CoreDNS alert), built on job="integrations/kubernetes/kube-dns". It lands after #1130.
Grouping. This item is a child of #1128 (monitoring cleanup), not of #551.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 21, 2026
Checked on
release/v0.2.38at 14d4490, 2026-10-22. The code scope of this item is delivered:clusterMetrics.kubeDNS(k8s/monitoring/k8s-monitoring-values.yaml), with the server's service-endpoints scrape of kube-dns off, so CoreDNS is scraped once.kube-systemport 9153 (k8s/monitoring/networkpolicy.yaml).k8s/monitoring/dashboards/coredns.json, overjob="integrations/kubernetes/kube-dns", with the panels this item lists:tests/fixtures/metrics/coredns.yamland the CoreDNS case intests/test_stack_dashboards.py, which checks the dashboard's metric names and labels against the capture.Pending a person: on the homelab,
devops prometheus query 'up{job="integrations/kubernetes/kube-dns"}'reads 1,sum(rate(coredns_dns_requests_total[5m]))returns a value, and every dashboard panel returns data. No code remains for this item; a CoreDNS alert, which the amendment calls optional, was not added.feat(k8s): coredns metrics, dashboard, and servfail alert (Closes #822)…
dan-petty commentedon Oct 21, 2026
What changed
#1795, merged into
release/v0.2.38as ddf7a0f.5 file(s) changed.
How it was verified
Check runs at 7c9bc43:
Acceptance Criteria of
docs/agent/tasks/task-822-coredns-metrics-and-dashboard.md:up{service="kube-dns"}(job="integrations/kubernetes/kube-dns") reads1throughdevops prometheus query, andsum(rate(coredns_dns_requests_total[5m]))returns a live value (2.025).k8s/monitoring/dashboards/coredns.jsonreturns data on the cluster.tests/test_stack_dashboards.pycovers the CoreDNS metric names, label names, and single explicit scrape path (_coredns_monitored).tests/test_k8s_monitoring_alerting.pyverifiesCoreDnsServfailResponsesinhomelab-servicesagainstSERVED_SERIES.feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)