Repository navigation
Description
Problem
k8s/monitoring/service-aliases.yaml:61-75 (added by #977, PR #978, in v0.2.25) declares Service/monitoring/pyroscope as a plain manifest. The grafana/pyroscope release that devops k8s deploy-stack --stack infra installs (stack_lifecycle.py:110-113) creates a Service with the same name. On a cluster where that Service doesn't exist yet, such as the devcontainer's fresh minikube, the alias is applied first, and Helm then refuses to install Pyroscope: the Service has no Helm ownership metadata. Found by the Copilot review of release PR #1089 (thread PRRT_kwDOThbRVc6orUOX).
On homelab-k3s, the live pyroscope Service is owned by the pyroscope Helm release (revision 9), so nothing fails there today. Applying the alias manifest still edits a Helm-owned object.
Acceptance criteria
- The
pyroscopealias is removed. Every consumer (Grafana's Pyroscope datasource, port-forward targets, dashboards, docs) uses the chart's ownpyroscopeService. - A test fails when any manifest outside a Helm chart declares a Service that a release in
_HELM_RELEASES_BY_STACKcreates under the same name and namespace. That catches the next alias of this kind. - Pending a person: on a fresh minikube,
uv run devops k8s deploy-stack --stack infrainstalls Pyroscope.
Strategic alignment
- P1 bug. A fresh
deploy-stackcan't install Pyroscope. The homelab is unaffected. - Related: feat(k8s): expose pyroscope ui endpoints, port-forwarding and grafana dashboards #977, feat(release): v0.2.25 #1089, refactor(docs): no documentation-only pull requests: release artifacts are made as the release merges, and every kept doc changes with its code or is deleted #1103.
Consolidated from #818 (with the monitoring audit's widening)
Problem (added). The pyroscope alias is one of four alias Services in k8s/monitoring/service-aliases.yaml: prometheus, kube-prometheus-kube-prome-prometheus, kube-prometheus-grafana and pyroscope. Since #912 the root kustomization (k8s/kustomization.yaml:8-10) puts the file into the kustomize base, and deploy-stack applies that base before any Helm release. So #818's line "deploy-stack never applies that file" is stale. At 14e5da1 the CLI still looks up the kube-prometheus names:
commands/k8s/networking.py:378-381(configure-urls);:496-500and:702(theprome-prometheusfragment, the only pattern forprometheus.url's ingress lookup, which can never match);:952-955(port-forward);k8s/credentials.py:170(kube-prometheus-stack-grafanafirst);k8s/service_proxy.py:314,tests/test_k8s_proxy_addressing.py:48-68andtests/test_k8s_bootstrap.py:353-354.
The prometheus alias duplicates the chart's prometheus-server Service (monitoring audit, 2026-10-03). service-aliases.yaml:4-16 (#912) declares Service prometheus with selector name=prometheus, component=server and no app.kubernetes.io/instance pin. kube-prometheus-kube-prome-prometheus has the same selector. Only the chart's prometheus-server pins instance=prometheus, and it already listens on 9090 (k8s/monitoring/prometheus-values.yaml:30-31). All three resolve to the one server pod today; prometheus-values.yaml:274-275 and :324-325 record a second Prometheus scraped on 2026-10-01/02, which an unpinned selector would have joined. Consumers of the alias:
k8s/monitoring/k8s-monitoring-values.yaml:12(destinations.localPrometheus);k8s/monitoring/grafana-values.yaml:51(datasource);k8s/ingress/ingress-routes.yaml:162(prometheus-ingressbackend);src/devops_cli/crypto/tls_certificates.py:338(prometheus.monitoring.svcSAN);networking.py:378-382, which falls back toprometheusand never looks upprometheus-server.
Objects left by kube-prometheus-stack on the live cluster, with no Helm release or operator behind them (checked 2026-10-03; metadata only):
- Secret
monitoring/kube-prometheus-kube-prome-admission, created 2026-08-19; - Service and Endpoints
kube-system/kube-prometheus-kube-prome-kubelet(labelsmanaged-by=prometheus-operator,k8s-app=kubelet; no selector), whose mirrored EndpointSlice still lists every node's address.
Argo CD's prune (#755) deletes only objects that carry its tracking label, so it will never remove these.
Acceptance criteria (added).
-
k8s/monitoring/service-aliases.yamlis deleted, along with its entry and comment ink8s/kustomization.yaml:8-10and its lines ink8s/README.md(:407,:410). - Every consumer of the
prometheusalias points atprometheus-server.monitoring.svc.cluster.local:9090: Alloy'slocalPrometheusdestination URL (.../api/v1/write), the Grafana Prometheus datasource,prometheus-ingress's backend, the TLS SAN list, andport-forward/configure-urls(svc/prometheus-server,svc/grafanaport 80).git grep -n 'prometheus\.monitoring\.svc' -- k8s src testsprints nothing. -
server.fullnameOverride: prometheusis not used. In chart 29.35.0 it also renames the server Deployment and theprometheus-serverPVC, which would orphan 30 days of TSDB data and break the rules that selectpersistentvolumeclaim="prometheus-server"(prometheus-values.yaml:277, 302). - The guard test above is computed from the repo alone. No Service in the kustomize base, or in any plain manifest that deploy-stack applies, sits in a namespace that a release in
_HELM_RELEASES_BY_STACKinstalls into, unless an exemption names its owner. The test renders no chart and keeps no hand-written list of chart Service names. - From chore(k8s): drop the kube-prometheus-stack service aliases #818:
rg -n 'kube-prometheus|prome-prometheus' k8s src testsfinds only the upstream dotdc dashboard descriptions and the historical note intests/test_k8s_monitoring_alerting.py:274. - From chore(k8s): drop the kube-prometheus-stack service aliases #818:
configure-urlsresolves thegrafanaService and the Prometheus server Service. A test with a Prometheus ingress whose backend is the Prometheus server Service setsprometheus.urlto that ingress's host. - From chore(k8s): drop the kube-prometheus-stack service aliases #818:
fetch_grafana_passwordfinds the password in thegrafanasecret, andkube-prometheus-stack-grafanais no longer a candidate. - From chore(k8s): drop the kube-prometheus-stack service aliases #818:
port-forwardtargetssvc/grafanaandsvc/prometheus-server. Test fixtures and docstrings name the Services the current charts create. - Done on 2026-10-08, by an agent after a server-side dry run, with the owner's go-ahead. The Endpoints went with their Service:
Before the deletion, Prometheus showed these Services only as
kubectl delete secret -n monitoring kube-prometheus-kube-prome-admission kubectl delete service,endpoints -n kube-system kube-prometheus-kube-prome-kubeletkube_service_inforows from kube-state-metrics, with no scrape job using them. No admission webhook configuration was left behind. - Pending a person, or an agent showing a diff first, once after the deploy (
kubectl apply -kdoes not prune):Expected:kubectl delete service -n monitoring prometheus kube-prometheus-kube-prome-prometheus kube-prometheus-grafanakubectl get svc -n monitoringlists only chart-owned Services, andkubectl get endpointslices -n kube-system | grep kube-promeprints nothing. - Folded in on 2026-10-08: the
homelabAppProject (k8s/argocd/apps/projects.yaml) lists{group: argoproj.io, kind: AppProject, name: default}underorphanedResources.ignore.- Argo CD creates the
defaultproject itself, so no Application tracks it. Today it is the only orphan behind the OrphanedResourceWarning on theargocdandbaseApplications. - A file-only test asserts the entry.
- Pending a person, after Argo CD syncs the project:
kubectl -n argocd get applications -o jsonshows noOrphanedResourceWarningcondition on any Application. On 2026-10-08, after the cleanup above and fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548's Fluent Bit uninstall, onlyargocdandbasestill had one.
- Argo CD creates the
- Tests never touch the network or a cluster.
changelog.d/1104.mdrecords the change.uv run devops cipasses.
Key questions (added).
- Remove the
prometheusalias too, reversing chore(k8s): drop the kube-prometheus-stack service aliases #818's "keep the prometheus alias"? (proposed) Yes. The chart Service exists on 9090. Repointing the consumers above removes the last alias, and the guard becomes a plain rule. The monitoring audit reached the same answer independently. - Does this wait for the otel collector to stop writing through Alloy (fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132)? (proposed) No. The collector writes to Alloy's receiver, and this item repoints Alloy's destination. Whichever of the two lands second rebases
k8s-monitoring-values.yaml. - Exact names or substring patterns in configure-urls? (proposed) The Prometheus lookups this item rewrites read exact (key, namespace, service) entries from
CONST_K8S_INGRESS_SERVICE_PATTERNS(config/constants.py:2974), which nothing reads today. fix(k8s): tunnel sync and url setup still overwrite settings they should keep #794 (v0.2.28) moves the gateway lookup onto the same table, and whichever lands second reuses it. - One manifest-ownership guard or two? (proposed) One. fix(k8s): deploy-stack applies the monitoring namespace perimeter #913 (v0.2.29) adds the repo-wide NetworkPolicy deploy-path guard. Whichever lands second folds the other's check into it.
Constraint (from #818). The upstream text "Made for kube-prometheus-stack" in the dotdc dashboard descriptions stays. CHANGELOG history is not rewritten.
Placement and grouping. This item stays P1 in the backlog (#818 was P2). Effort goes from Low to Low-Medium. It is a child of #1128 (monitoring cleanup), which carries no separate alias item. Related: #794, #913, #795, #408 (leftover detection), #1031 (moves the service-name constants), #1111 (tests/test_k8s_proxy_addressing.py:54; whichever lands second adopts the other's value).
Update 2026-10-08: refinement
The title's bug is fixed: #1281 deleted the pyroscope alias. Left: the three other aliases and the lookups (commands/k8s/networking.py:378-381, :490-494, :946-949; k8s/credentials.py:169). Suggested title: fix(k8s): the monitoring alias Services and the kube-prometheus lookups are removed, and every consumer uses the charts' own Services. The base Application prunes tracked aliases from main.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 10, 2026
Moved to v0.2.34: v0.2.34 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
fix(k8s): remove monitoring Service aliases and direct consumers to H…
dan-petty commentedon Oct 11, 2026
Merged
feat(release): v0.2.34 (#1566)