Repository navigation
Description
Problem or Motivation
The service catalog of the SRE spec (Table 2: service, namespace, instances, data stores, dashboards) is a hand copy of facts that git holds. The rollout and backup bullets of the spec and parts of the Kubernetes performance spec (storage classes, databases, PriorityClasses, RuntimeClasses, the profiler DaemonSet, CronWorkflows) are hand copies too. Rule SRE1 tells an agent to add a row by hand for each new service.
Hand copies drift. Two drafts of 2026-11-13 count the containers with no memory limit as 13 of 52 and as 25 of 115, with different scopes. The owner direction of 2026-11-13: an agent must not update each detail of the service layout by hand.
Proposed Solution & Architectural Design
Add devops k8s catalog [--k8s-dir DIR] [--check] [--format markdown|json] [--dry-run].
- Render each Argo CD Application of the environment tree with the renderer of
devops k8s image-pins(_application_rendersinsrc/devops_cli/k8s/image_pins.py). Make that function public and share it. Do not write a second renderer. - From each render, read:
- each workload (Deployment, StatefulSet, DaemonSet, CronJob, CronWorkflow): namespace, replicas, update strategy,
terminationGracePeriodSeconds, containers with requests, limits and probes, PriorityClass, RuntimeClass; - each store: PersistentVolumeClaim and
volumeClaimTemplateswith the storage class, CloudNativePGClusterwith its instances,ScheduledBackup; - the cluster classes: PriorityClass, RuntimeClass, StorageClass;
- the
gethomepage.dev/descriptionannotation of each UI object of feat(k8s): list each service UI on the start page #4600: an Ingress, a Traefik IngressRoute, orspec.ingress.annotationsof a Mattermost resource.
- each workload (Deployment, StatefulSet, DaemonSet, CronJob, CronWorkflow): namespace, replicas, update strategy,
- Read the decision file
k8s/catalog.toml, which the SRE split (docs(monitoring): split the SRE spec into a guideline and decisions #5538) adds. Each[[service]]table hasname,applications, an optionalworkloadslist (for an Application that holds more than one service), an optionaldescription,tier,data_classand an optionaldepends_on. It holds no SLO id and no dashboard uid, because other files already hold them. - Take the description of each service from one place (owner decision of 2026-11-13). When a UI object of the service carries the
gethomepage.dev/descriptionannotation (feat(k8s): list each service UI on the start page #4600), the catalog shows that text. A UI object belongs to a service when its Application is an Application of the entry, and, for an entry with aworkloadslist, when its backend Service selects one of those workloads.k8s/catalog.tomlholds adescriptiononly for a service with no such annotation, such as a service with no UI. - Join the service dashboards from
k8s/monitoring/dashboards/services.tomlby namespace and workload. When the Sloth spec files of feat(monitoring): define the Service SLOs in a Sloth spec #4709 exist ink8s/monitoring/slos/, join the SLI, the objective and the window of each SLO by theservicefield of the spec, which equals the catalogname. - Write
k8s/CATALOG.md. Its first line under the title is "Generated byuv run devops k8s catalog. Do not edit this file." Sections: Services, SLOs, Workloads by Application, Stores, Cluster classes. - Exit 1 with the name of the object when:
- a workload of the render belongs to no catalog entry (an entry claims all the workloads of its Applications, or only those of its
workloadslist); - a catalog entry names an Application or a workload that the render does not hold;
- a Sloth spec or a
services.tomltable names a service or a workload that the catalog does not hold; - a catalog entry has a
descriptionand a UI object of the same service carries the annotation, so the description is in two places.
A tier 1 or tier 2 service with no SLO or no dashboard is not an error: the catalog shows "none", and feat(monitoring): give each tier 1 and 2 service an SLO and a dashboard #5475 tracks it. A service with no description in either place shows "none" too.
- a workload of the render belongs to no catalog entry (an entry claims all the workloads of its Applications, or only those of its
--checkcompares the output withk8s/CATALOG.mdand exits 1 on a difference. The Image Pins workflow (.github/workflows/image-pins.yml) runs--check, because the chart render needs the network. That workflow is not a required check, and it stays optional (owner decision of 2026-11-13): the next pull request that changesk8s/**shows the drift. When the environment tree moves to the infra repo, feat(k8s): run the environment checks in homelab CI #5296 brings the check to the CI of that repo.--dry-runmakes zero requests and runs nohelm. It lists the charts that a run pulls.- Add
k8s/CATALOG.mdto the generated class ofCONST_DOCS_INVENTORY(src/devops_cli/config/constants.py), so the docs checks, the review skip and chore(docs): mark the generated documents as generated #4888 treat it as generated. Link it from "Service levels" ofk8s/README.md. Rule SRE1 ofdocs/guidelines/sre.mdalready says "add an entry to the catalog data".
The files are in the environment tree, so they move with it to the infra repo (#5120).
Related: #3932 also makes the renderer of devops k8s image-pins public for its chart image list; whichever item lands first shares it, and the other reuses it. #5480 lists the workloads that no Application manages from the live cluster; this item reads only the render, so the two do not overlap. #4600 adds the Homepage annotations that this item reads.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
- kustomize (Apache-2.0, v5.8.3) and Helm (Apache-2.0, v4.3.1 pinned) render the Applications through the existing image-pins code. This item reuses them.
- Backstage Software Catalog (Apache-2.0) is the open tool for a service catalog. It is a running portal with a database, and each component needs its own
catalog-info.yaml. That is one more service for a table of about 20 rows, so this item does not use it. - KubeDiagrams (Apache-2.0, v0.9.0) draws a diagram from manifests, not a table.
- Cog (MIT) writes text between markers. DocGenerator already does that, and Cog cannot render Helm charts.
- Homepage (gethomepage.dev) annotations already hold the description of each service UI (feat(k8s): list each service UI on the start page #4600). This item reads them and keeps no second copy.
Cost to build: about 280 lines with tests, about 320k tokens, about 1 agent-day. The upkeep is low, because the renderer is shared with devops k8s image-pins.
Acceptance Criteria
- A test with a fixture environment tree (one kustomize Application, one chart Application with a recorded
helm templateoutput) gives the expectedk8s/CATALOG.md(snapshot test, no network). - A test: a tier 1 workload with no catalog entry exits 1 and names the workload.
- A test: a Sloth spec whose
servicehas no catalog entry exits 1 and names it. - A test: a service whose Ingress carries
gethomepage.dev/descriptionshows that text; the same service with adescriptionink8s/catalog.tomlexits 1 and names the service. - A test:
--checkon a stale file exits 1; on a current file it exits 0. - A test:
--dry-runsends no request and runs no subprocess. - The Image Pins workflow runs
devops k8s catalog --check. -
k8s/README.md"Service levels" linksk8s/CATALOG.mdand holds no service table. -
k8s/CATALOG.mdis in the generated class ofCONST_DOCS_INVENTORY. -
docs/CLI_REFERENCE.mdand the command page are regenerated (uv run devops docs generate).
Alternatives check of 2026-11-23: partly.
Tool: backstage/backstage (https://github.com/backstage/backstage), Apache-2.0, last activity 2026-11-23, maintained.
Reason: Searches found Backstage, the open software catalog: it holds services, ownership and dashboard links, but it is a running portal that needs one catalog-info.yaml per component, renders no manifests and writes no markdown with a drift check.
Covers:
- Catalog of services, systems, domains and ownership
- Per-service metadata, dependencies and dashboard links
- Portal UI and search over the catalog
Lacks:
- No render of Helm or Kustomize Applications
- No generated markdown catalog or --check drift gate
- A running portal plus one catalog-info.yaml per component
- No read of gethomepage.dev annotations or Sloth specs
Proposed design
Problem statement
Build the command in devops-cli and defer the environment-tree artifacts. The service catalog and parts of the SRE and Kubernetes specs are hand copies of facts in git, and they drift. Add devops k8s catalog. It renders the Applications, joins k8s/catalog.toml, the dashboards and the Sloth specs, and writes a catalog with a --check gate. The environment tree is frozen and moves to dan-petty/homelab (#5296), so this item delivers the command and its offline tests. It defers the committed catalog file, the README link, the docs inventory entry and the CI check to that move.
Acceptance criteria
Requirement: Shared Application renderer
The catalog command SHALL render each Argo CD Application of the environment tree with the shared _application_renders renderer.
Scenario: Fixture environment tree
- WHEN the test runs
devops k8s catalog --k8s-dir <fixture>with one kustomize Application and one chart Application whosehelm templateoutput is recorded - THEN the command exits 0 and writes
<fixture>/CATALOG.mdwith the Services, SLOs, Workloads by Application, Stores and Cluster classes sections
Requirement: Workload glob patterns
The catalog command SHALL match each workloads value as an exact workload name or an fnmatch pattern.
Scenario: Glob pattern
- WHEN the fixture entry has
workloads = ["ollama-*"]and the render holdsollama-48gibandollama-64gib - THEN both workloads belong to the entry and the command exits 0
Requirement: Operator objects are workloads
The catalog command SHALL count a CloudNativePG Cluster and a Mattermost resource as workloads of their catalog entry.
Scenario: Operator object
- WHEN the fixture render holds a CloudNativePG
Clusternamedllm-gateway-dband a Mattermost resource namedmattermost, and entries claim them - THEN the command exits 0 and the two objects appear under their entries, not as unclaimed workloads
Requirement: UI object matched by backend Service
The catalog command SHALL assign a UI object to a service by the namespace and the workloads that its backend Service selects.
Scenario: UI in ingress Application
- WHEN the fixture render holds an Ingress in Application
ingresswhose backend Service selects workloadroadmap-servicein namespacedevops - THEN the catalog shows the
gethomepage.dev/descriptionannotation text on theroadmap-servicerow
Requirement: Multiple UI descriptions
The catalog command SHALL show one description line for each UI annotation of a service, sorted by namespace and name.
Scenario: Two UI annotations
- WHEN the fixture entry has two UI objects with different annotations
- THEN the row shows both texts on separate lines in a stable order
Requirement: Description sources
The catalog command SHALL take each service description from its UI annotation, else from its description in k8s/catalog.toml, else show none.
Scenario: Three description sources
- WHEN the fixture has one service with an annotation, one service with a catalog
descriptionand no UI, and one service with neither - THEN the three rows show the annotation text, the catalog text and
none
Requirement: Duplicate description
The catalog command SHALL exit 1 when a catalog entry has a description and a UI object of the same service carries the annotation.
Scenario: Description in two places
- WHEN the fixture
roadmap-serviceentry hasdescriptionand its Ingress carriesgethomepage.dev/description - THEN the command exits 1 and names
roadmap-service
Requirement: Unclaimed workload
The catalog command SHALL exit 1 when a rendered workload belongs to no catalog entry.
Scenario: No entry
- WHEN the fixture render holds workload
open-webuiand no entry claims it - THEN the command exits 1 and names
open-webui
Requirement: Missing object
The catalog command SHALL exit 1 when an entry names an Application or a workload that the render does not hold.
Scenario: Missing workload
- WHEN a fixture entry names workload
goneand no render holds it - THEN the command exits 1 and names
gone
Requirement: Unknown SLO or dashboard name
The catalog command SHALL exit 1 when a Sloth spec or a dashboard table names an unknown service or workload.
Scenario: Unknown Sloth service
- WHEN a fixture Sloth spec under
devops/monitoring/slos/hasservice = "unknown"and the catalog holds nounknown - THEN the command exits 1 and names
unknown
Requirement: Missing SLO or dashboard is not an error
The catalog command SHALL show none for a tier 1 or a tier 2 service with no SLO or no dashboard.
Scenario: Tier 1 with no SLO
- WHEN a fixture tier 1 service has no Sloth spec and no service dashboard table
- THEN the command exits 0 and the row shows
nonefor the SLO and the dashboard
Requirement: Check drift
The catalog command SHALL exit 1 when --check finds a difference, and exit 0 when the file matches.
Scenario: Out-of-date file
- WHEN the test runs
devops k8s catalog --check --k8s-dir <fixture>on an out-of-date file and then on the current file - THEN the first run exits 1 and the second run exits 0
Requirement: Dry run
The catalog command SHALL make zero requests and run no helm with --dry-run.
Scenario: Dry run
- WHEN the test runs
devops k8s catalog --dry-run --k8s-dir <fixture>with a fake client and a fake subprocess - THEN no request and no subprocess call is recorded, and the command lists each chart that a run pulls
Requirement: Sloth SLO join
The catalog command SHALL join each Sloth spec under devops/monitoring/slos/ by its service field to the catalog entry with the same name.
Scenario: SLO join
- WHEN the fixture holds a Sloth spec under
devops/monitoring/slos/withservice = "roadmap-service" - THEN the
roadmap-servicerow shows the SLI, the objective and the window of that spec
Requirement: Service dashboard join
The catalog command SHALL join each service dashboard from monitoring/dashboards/services.toml by namespace and workload.
Scenario: Dashboard join
- WHEN the fixture holds a service dashboard table for namespace
devopsand workloadroadmap-service - THEN the
roadmap-servicerow shows that dashboard
Requirement: Generated header
The catalog command SHALL write the generated line under the title of the markdown file.
Scenario: Generated header
- WHEN the test runs the command on a fixture
- THEN the first line under the title is "Generated by
uv run devops k8s catalog. Do not edit this file."
Requirement: JSON format
The catalog command SHALL write JSON with --format json.
Scenario: JSON format
- WHEN the test runs
devops k8s catalog --format json --k8s-dir <fixture> - THEN the command exits 0 and writes a JSON object with the services, SLOs, workloads, stores and cluster classes
Requirement: CLI reference regenerated
docs/CLI_REFERENCE.md and the command page SHALL list devops k8s catalog.
Scenario: Docs generation
- WHEN
uv run devops docs generateruns and thenuv run devops ci --check --only docsruns - THEN the docs check passes and the command page lists
devops k8s catalog
Existing Tool Considered
Backstage (backstage/backstage, Apache-2.0, maintained) is the tool of the alternatives check of 2026-11-23; its verdict is partly. The alternatives check in the issue body records what the tool covers and lacks. The proposal does not run the portal. It reuses _application_renders and writes the generated markdown with a --check gate. The written cost to build the missing parts is about 280 lines with tests, about 320k tokens and about 1 agent-day.
Key questions
- How should the item handle the frozen environment tree?: Build the command and its offline tests in devops-cli. Defer the committed
k8s/CATALOG.md, thek8s/README.mdlink, theCONST_DOCS_INVENTORYentry and the Image Pins check to the move todan-petty/homelab(feat(k8s): run the environment checks in homelab CI #5296). (best practice) [sources: tests/gate/k8s_checks/environment_freeze.py, docs/HOMELAB_REPO_SWITCH.md, tests/docs/test_docs_inventory.py]- Chosen: Defer the environment-tree artifacts. The freeze refuses the change, and the docs inventory test refuses a generated entry that no generator writes.
- Rejected: Update the frozen tree in this item. The freeze refuses the change, and the environment tree leaves this repository.
- Rejected: Block the whole item. The command and its offline tests do not need the environment tree.
- Which renderer should the catalog use?: Use
_application_rendersfromdevops k8s image-pins. Make it public and share it. Write no second renderer. (best practice) [sources: src/devops_cli/k8s/image_pins.py:245]- Chosen: Share
_application_renders. It renders a path source withkubectl kustomizeand a chart source withhelm template, and it has tests. - Rejected: Write a catalog renderer. It duplicates Helm and Kustomize handling and drifts from image pins.
- Chosen: Share
- Where are the Sloth specs?: Read Sloth specs under
k8s/devops/monitoring/slos/in the current tree. The old pathk8s/monitoring/slos/is wrong. [sources: docs/HOMELAB_REPO_SWITCH.md] - How should
workloadsmatch rendered workloads?: Read each value as an exact workload name or anfnmatchpattern. (best practice) [sources: k8s/catalog.toml]- Chosen: Name or
fnmatchpattern. The file usesollama-*, so a new tier of the same kind needs no edit. - Rejected: Exact names only. A new Ollama tier then needs an edit of the file.
- Chosen: Name or
- Which operator objects count as workloads?: Count a CloudNativePG
Clusterand a Mattermost resource as workloads of their entry. (best practice) [sources: k8s/catalog.toml]- Chosen: Include operator objects. The operator makes their pods, so the render holds no Deployment or StatefulSet for them.
- Rejected: Only built-in workload kinds. The command then exits 1 on the
gateway-dbandmattermostentries.
- How does a UI object find its service when the UI object is in another Application?: Use the backend Service of the UI object: its namespace and the workloads that it selects. Do not use the Application of the UI object. (best practice) [sources: k8s/catalog.toml, k8s/ingress/ingress-routes.yaml]
- Chosen: By the backend Service. The UI objects live in Application
ingress, not in the Application of their service. - Rejected: By the Application of the UI object. The rule finds no UI object for a service outside Application
ingress.
- Chosen: By the backend Service. The UI objects live in Application
- How should the catalog show more than one UI annotation of one service?: Show one description line for each UI object, sorted by namespace and name. (best practice) [sources: k8s/catalog.toml]
- Chosen: One line for each UI. Each UI keeps its own description and the row stays stable.
- Rejected: One joined line. Two different UI descriptions lose their object and become one unclear text.
- Where does the service description come from?: From the
gethomepage.dev/descriptionannotation of a UI object when one exists. Usedescriptionink8s/catalog.tomlonly when no UI object carries the annotation. Shownonewhen neither holds a text. (best practice) [sources: k8s/catalog.toml]- Chosen: UI annotation first. The annotation is the one description of a service UI, and the catalog holds a fallback only.
- Rejected: Catalog
descriptionfirst. It keeps a second copy and conflicts with the owner decision of 2026-11-13.
- How should the catalog treat a missing SLO or dashboard?: Show
noneand exit 0 for a tier 1 or a tier 2 service. An unknown service or workload name is an error and exits 1. (best practice) [sources: k8s/catalog.toml]- Chosen: Show
none. The catalog stays readable, and a name that points to no catalog entry still fails. - Rejected: Error on each missing SLO or dashboard. A missing SLO is a tracking gap, and feat(monitoring): give each tier 1 and 2 service an SLO and a dashboard #5475 tracks it.
- Chosen: Show
- Should the Image Pins workflow make the catalog check a required check?: No. The check is deferred with the environment tree move. In the homelab CI it stays optional, because the chart render needs the network. (best practice) [sources: .github/workflows/image-pins.yml, docs/HOMELAB_REPO_SWITCH.md]
- Chosen: Optional check. The owner decision of 2026-11-13 keeps it optional, and the next
k8s/**pull request shows drift. - Rejected: Required check. The chart render needs the network, and the workflow is not a required check.
- Chosen: Optional check. The owner decision of 2026-11-13 keeps it optional, and the next
- How should the generated catalog stay out of hand edits?: The command writes the generated header and
--checkdetects drift. Defer theCONST_DOCS_INVENTORYentry to the homelab environment tree. (best practice) [sources: src/devops_cli/config/constants.py:491, tests/docs/test_docs_inventory.py]- Chosen: Defer the docs inventory entry. The test refuses an explicit generated entry that no
DocGeneratorwrites. - Rejected: Add the entry now. The test fails because no generator writes
k8s/CATALOG.md.
- Chosen: Defer the docs inventory entry. The test refuses an explicit generated entry that no
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both deal with k8s service and monitoring documentation, but #293 adds Grafana dashboards while the candidate generates a catalog that references them.dan-petty commentedon Nov 13, 2026
PR #5567 adds
k8s/catalog.toml, the input of this item. Four facts of that file change the design of the generator:workloads. The entrymodel-tiersgivesworkloads = ["ollama-*"], so a new Ollama tier needs no edit of the file. Read each value as a name or anfnmatchpattern.gateway-dbnames the CloudNativePGClusterllm-gateway-db. The entrymattermostholds theMattermostresource and the CloudNativePGClusterof its database. The operators make the pods, so the render holds no Deployment or StatefulSet for them. Count a CloudNativePGClusterand aMattermostresource as a workload of its entry. If not, step 7 exits 1 on them.ingress(k8s/ingress/ingress-routes.yaml), not in the Application of its service. So the rule "its Application is an Application of the entry" finds no UI object. Match a UI object to an entry by its backend Service: the namespace and the workloads that the Service selects.alloy(Applicationk8s-monitoring) has two UIs of feat(k8s): list each service UI on the start page #4600: Alloy metrics and Alloy logs. Give a rule for an entry with more than one annotation, such as one line for each UI.The file has one entry for each service of the old SRE.md Table 2. The render also holds workloads with no entry, such as Open WebUI, Portkey, the DCGM exporter and the operators. The first run of
devops k8s cataloglists them, and the pull request of this item adds their entries.devops-cli-service commentedon Nov 17, 2026
Alternatives check: partly
Reason: Searches found Backstage only: an open service catalog that holds services and dashboard links, but it is a running portal fed by hand-written catalog-info.yaml files and generates nothing from the rendered Applications.
Tool: backstage/backstage (https://github.com/backstage/backstage), Apache-2.0, last activity 2026-11-17, maintained.
Covers:
Lacks:
Searches (10)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 86358b6 (see proposed design in issue body).
dan-petty commentedon Nov 25, 2026
Cannot build
#5535as written indan-petty/devops-cli; returning toNewperAGENTS.mdRule 2:k8s/catalog.tomlblocks the required catalog generation and workflow check.tests/gate/k8s_checks/environment_freeze.pyfreezesk8s/catalog.toml(tests/invariants/test_environment_freeze_check.py:27:is_environment_path("k8s/catalog.toml") == True) whiledan-petty/homelabholds the environment (docs/HOMELAB_REPO_SWITCH.md). Against the committedk8s/tree, Applicationdevops(k8s/overlays/homelab/devops) renders 6 workloads not listed ink8s/catalog.toml(CronJob/devops-cli-planner-run,CronJob/repos-drift,CronJob/service-probe,CronJob/volume-move,CronWorkflow/infra-drift,CronWorkflow/rag-ingest),llmrenders unclaimedDeployment/portkey,gpu-feature-discoveryrenders unclaimedDaemonSet/gpu-feature-discovery, andcert-manager,cloudnative-pg,dcgm-exporter,open-webui,plugin-barman-cloud, andprometheus-operator-crdshave nok8s/catalog.tomlentry. Because RequirementUnclaimed workloadexits1on any unclaimed workload,uv run devops k8s catalogexits1on this tree, cannot writek8s/CATALOG.md, anduv run devops k8s catalog --checkin.github/workflows/image-pins.ymlfails unless frozenk8s/catalog.tomlis updated.CONST_DOCS_INVENTORYinvariants conflict with a generatedk8s/CATALOG.md.tests/docs/test_docs_inventory.py:66-79fails if an explicit entry inCONST_DOCS_INVENTORY[CONST_DOCS_CLASS_GENERATED](k8s/CATALOG.md) is absent from git, whiletests/docs/test_docs_inventory.py:150-173(test_the_generated_class_is_what_the_generator_writes) assertsgenerated_in_the_inventory ^ generated_by_the_generator == [], wheregenerated_by_the_generatoronly containsDocGenerator.generate_all_docs(REPO_ROOT / "docs")outputs plusCLAUDE.md,GEMINI.md, and.github/copilot-instructions.md.#5535was refined.#4709(#7032) placed the Sloth specs underk8s/devops/monitoring/slos/rather thank8s/monitoring/slos/, anddocs/HOMELAB_REPO_SWITCH.md(Step 16#5296, Step 17) moves environment checks todan-petty/homelaband deletes the environment tree fromdevops-cli.devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC