Skip to content

chore(k8s): drop the kube-prometheus-stack service aliases #818

Closed as not planned

Description

@dan-petty

Context & Rationale

#734 removed kube-prometheus-stack, and #738 restored Prometheus and Grafana as separate charts. #737/#738 added alias Services named after the removed stack so the CLI's hard-coded lookups kept working. That shim and every lookup it serves are still in place on release/v0.2.24:

  • Alias Services. k8s/monitoring/service-aliases.yaml:23, 42 defines kube-prometheus-kube-prome-prometheus and kube-prometheus-grafana. deploy-stack never applies that file, so a fresh cluster has no aliases at all (Related: fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795).
  • configure-urls looks the alias names up before the real grafana and prometheus Services (src/devops_cli/commands/k8s/networking.py:375-380).
  • port-forward targets svc/kube-prometheus-grafana and svc/kube-prometheus-kube-prome-prometheus (networking.py:936-939), so it fails on any cluster without the aliases.
  • The removed chart's name fragment. prome-prometheus is in _PROXY_TARGETS_INFRA (networking.py:487, with the :483 comment) and in _FQDN_TARGETS_INFRA (:687). At :687 it is the only pattern for prometheus.url's ingress lookup. It can never match the Prometheus ingress, whose backend is prometheus and whose host is prometheus.<domain> (k8s/ingress/ingress-routes.yaml:155, 162), so configure-urls never uses Prometheus's FQDN.
  • Grafana password. fetch_grafana_password tries the secret kube-prometheus-stack-grafana first (src/devops_cli/k8s/credentials.py:170). The grafana release creates grafana.
  • Docs and tests. The src/devops_cli/k8s/service_proxy.py:314 docstring, the fixtures and docstrings in tests/test_k8s_proxy_addressing.py:45-68 ("Prometheus ships as kube-prometheus-kube-prome-prometheus") and tests/test_k8s_bootstrap.py:352-353.
  • The prometheus alias in the same file is still needed: Grafana's datasource and Alloy use it (k8s/monitoring/grafana-values.yaml:43; k8s/monitoring/k8s-monitoring-values.yaml:12).

CLAUDE.md requires the codebase to stay clean of legacy references and obsolete shims.

Scope & Deliverables

  • Deliverable:
    • Remove the two kube-prometheus aliases and the fallback lookups in configure-urls.
    • Point port-forward at the Services deploy-stack creates: grafana, and the Prometheus server Service (or the kept prometheus alias).
    • Replace the prome-prometheus fragment at networking.py:487 and :687 with patterns that match the deployed Prometheus Service and ingress.
    • Drop kube-prometheus-stack-grafana from fetch_grafana_password's candidates.
    • Rename the test fixtures and fix the docstrings to the Service names the current charts create.
    • Keep the prometheus alias.
  • Acceptance criteria:
    • rg -n 'kube-prometheus|prome-prometheus' k8s src tests finds only the upstream dotdc dashboard descriptions.
    • configure-urls tests resolve the grafana and prometheus Services.
    • A configure-urls test with a Prometheus ingress whose backend is prometheus sets prometheus.url to that ingress's host.
    • A fetch_grafana_password test finds the password in the grafana secret.
    • A port-forward test targets svc/grafana and the Prometheus server Service.
    • Tests never touch the network or a cluster. uv run devops ci passes.
  • Constraint: The upstream text "Made for kube-prometheus-stack" in the dotdc dashboard descriptions stays. CHANGELOG history is not rewritten.

Strategic Alignment

Activity

  1. added
    type/chore
    scope/k8s
    priority/p2-medium
    on Oct 1, 2026
  2. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Merged into #1104: both remove the alias Services in k8s/monitoring/service-aliases.yaml. #1104 now deletes the whole file, repoints every consumer of the prometheus alias to the chart's prometheus-server Service, carries this item's criteria, and adds the monitoring audit's widening (the TLS SAN and ingress backend, no server.fullnameOverride, and the one-time deletion of the kube-prometheus-stack leftovers). #1104 is a child of #1128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/k8stype/chore

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions