Repository navigation
Description
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.
- Move the 3 product dashboards to
k8s/devops/dashboards/with their own kustomization: namespacemonitoring, the same generatorOptions and the ConfigMapgrafana-devops-cli-dashboards. List../../devops/dashboardsink8s/monitoring/dashboards/kustomization.yaml. Applicationmonitoringstays the owner of the ConfigMap. - Do not list
dashboardsin thek8s/devopsroot. Add a product test for this rule. If the root lists the folder, Applicationdevopstakes a ConfigMap that Applicationmonitoringowns. - Move the 9 product rule groups to
k8s/devops/monitoring/prometheus-rules-values.yamlunder a newserverFileskey. Applicationprometheuslists this file as a second$valuesvalueFile. The environment values setrule_filesto the 4 defaults plus the new file (5 entries). - Change the
valuesfield ofHELM_RELEASES_BY_STACK(stack_lifecycle.py:175) to a list, so that a native deploy installs both files. Changetest_k8s_argocd_apps.py:205, which accepts exactly one valueFile. - Re-point each reader of the rules:
test_k8s_monitoring_alerting.py:288-1657,test_k8s.py:1293,test_k8s_rag_ingest_manifests.py:105and therule_filesof the product promtool fixtures. - 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. - Delete the duplicate Ingress
roadmap-serviceand the delete patch of the ingress overlay. - Leave
workflowtemplate-version.yamlwhere it is. build(k8s): pin the product base to a release tag #5135 moves it with its release pin.
Check.
kubectl kustomizeofk8s/monitoringand ofk8s/overlays/homelab/ingressgives the same output before and after the change.helm templateof the prometheus chart with both values files gives the same alert set (count and names).- promtool passes.
devops k8s deploy-stack --stack infra --dry-runnames both values files.- After the merge,
argocd app diff --core --exit-codeis 0 for each Application exceptprometheus. Argo CD prunes nothing. The live rule API shows the same number of alert rules. uv run devops cipasses.
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
dan-petty commentedon Nov 13, 2026
Both manage the k8s/monitoring/dashboards kustomization and Application ownership of the Grafana ConfigMap, but #1297 fixed a regression where deploy-stack stopped applying dashboards while the candidate reorganizes product dashboards intodevops-cli-service commentedon Nov 13, 2026
Released in v0.125.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.125.2
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 01:49 UTC
test(k8s): expect the product rules under the product base
test(grafana): lint only the tree dashboards in an infra repo