Skip to content

refactor(k8s): split the product dashboards and rules in place #5292

Closed

Description

@dan-petty

Problem or Motivation

The homelab environment moves to the private repository dan-petty/homelab (tracker #5120, phase 2). Some files under k8s/monitoring/ are product content, not environment content. These are the 3 product dashboards (devops-cli.json, ai-spend.json, project-metrics.json) and the 9 product alert rule groups with 27 alerts in k8s/monitoring/prometheus-values.yaml (lines 697-1073 and 1142-1152). They chart and watch the devops_cli_* series, so they stay in devops-cli. Today they are in the same files as the environment content, so the copy to homelab (dan-petty/homelab#23) cannot leave them behind. The Ingress roadmap-service also has a duplicate that a delete patch of the ingress overlay removes.

Proposed Solution & Architectural Design

Step 2 of the corrected plan on #5120. One pull request in devops-cli. No file leaves the repository.

  1. Move the 3 product dashboards to k8s/devops/dashboards/ with their own kustomization: namespace monitoring, the same generatorOptions and the ConfigMap grafana-devops-cli-dashboards. List ../../devops/dashboards in k8s/monitoring/dashboards/kustomization.yaml. Application monitoring stays the owner of the ConfigMap.
  2. Do not list dashboards in the k8s/devops root. Add a product test for this rule. If the root lists the folder, Application devops takes a ConfigMap that Application monitoring owns.
  3. Move the 9 product rule groups to k8s/devops/monitoring/prometheus-rules-values.yaml under a new serverFiles key. Application prometheus lists this file as a second $values valueFile. The environment values set rule_files to the 4 defaults plus the new file (5 entries).
  4. Change the values field of HELM_RELEASES_BY_STACK (stack_lifecycle.py:175) to a list, so that a native deploy installs both files. Change test_k8s_argocd_apps.py:205, which accepts exactly one valueFile.
  5. Re-point each reader of the rules: test_k8s_monitoring_alerting.py:288-1657, test_k8s.py:1293, test_k8s_rag_ingest_manifests.py:105 and the rule_files of the product promtool fixtures.
  6. Re-point each reader of the dashboards: DEFAULT_GRAFANA_DASHBOARDS_DIR (defaults.py:84), which sync and lint read with a glob that does not recurse (grafana.py:303-304); test_grafana.py:23; test_dashboard_queries.py; the dashboard tests; docs/generator.py:985-991. Lint and sync cover both folders until refactor(k8s): read the environment tree from the infra repo #5131.
  7. Delete the duplicate Ingress roadmap-service and the delete patch of the ingress overlay.
  8. Leave workflowtemplate-version.yaml where it is. build(k8s): pin the product base to a release tag #5135 moves it with its release pin.

Check.

  • kubectl kustomize of k8s/monitoring and of k8s/overlays/homelab/ingress gives the same output before and after the change.
  • helm template of the prometheus chart with both values files gives the same alert set (count and names).
  • promtool passes.
  • devops k8s deploy-stack --stack infra --dry-run names both values files.
  • After the merge, argocd app diff --core --exit-code is 0 for each Application except prometheus. Argo CD prunes nothing. The live rule API shows the same number of alert rules.
  • uv run devops ci passes.

Rollback. git revert. Argo CD syncs main again.

Downtime. None. Prometheus reloads its config. The 9 product groups start their for timers again one time.

Order and dependencies. Plan step 2. It has no open dependency. It must merge before the copy (dan-petty/homelab#23, plan step 9), and release vX (plan step 6) must include it. #5131 PR 1 (plan step 4) can go in parallel. A person merges.

Target Subsystem

Kubernetes & Minikube Automation

Existing Tool Considered

Kustomize resources, the serverFiles values of the Prometheus Helm chart and the Argo CD multi-source $values ref cover the split. The live chart (prometheus-29.47.2) renders each serverFiles key into the ConfigMap prometheus-server. No new tool. Cost: about 2M tokens to build, 0.1M a quarter to keep, 4 hours.

Source: #5120

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/refactor
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 13, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  6. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor
  7. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 01:49 UTC

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

    effort/mediumpriority/p2-mediumscope/k8ssource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions