Catalog as code with catalog-info.yaml
For administrators, engineers 8 min read
Describe each service in a file in its repository. ELOS reads it on every sync, so the catalog changes through reviewed pull requests.
Before you begin
- Source control connected to ELOS (set up with our team during onboarding).
When source control is connected, every repository becomes a service in ELOS. A catalog-info.yaml file in the repository describes that service: its tier, lifecycle, owner, links and more. The file is the source of truth for every field it sets, and changes to it go through your normal pull-request review.
Add the file
- Download the template or copy the example below.
- Save it as
catalog-info.yamlat the root of the repository.catalog-info.ymland.elos/catalog.yamlalso work. - Fill in the fields you want ELOS to take from code. Leave out anything you'd rather manage in ELOS.
- Merge the pull request. The next sync applies it.
apiVersion: elos/v1
kind: Service
metadata:
description: Card payment authorisation and capture
tags: [payments, pci]
annotations:
cost-center: CC-4020
spec:
type: service
tier: tier-1
lifecycle: production
system: Payments Platform
domain: Payments
language: Go
frameworks: [grpc]
owner: Payments
providesApis: [payments.v1]
consumesApis: [ledger.v1]
links:
- { kind: runbook, label: On-call runbook, url: https://wiki.example.com/payments/runbook }Field reference
| Field | Values | Shown in ELOS as |
|---|---|---|
metadata.description | Text | The service description |
metadata.tags | List of words | Tags, searchable |
metadata.annotations | Any key: value pairs | Metadata on the service page, for example a cost centre |
spec.type | service, website, library, datastore, job | Type |
spec.tier | tier-1 (most critical), tier-2, tier-3 | Tier; drives priority, approvals and read scope by tier |
spec.lifecycle | production, beta, deprecated | Lifecycle |
spec.system, spec.domain | Text | The system and domain it belongs to |
spec.language, spec.frameworks | Text, list | Language and frameworks |
spec.owner | A team name, or a person's full name | Owner |
spec.providesApis, spec.consumesApis | Lists of API names | APIs the service provides and consumes |
spec.links | List of kind, label, url | Links on the service page, such as runbooks and dashboards |
How ELOS applies it
- The file wins for the fields it sets. On every sync, a declared field replaces whatever is in ELOS. To edit a field in ELOS instead, remove it from the file.
- Fields the file doesn't set are yours. Anything you edit in ELOS that the file doesn't mention is kept.
- Owner. ELOS sets the owner from the file when the service has no owner yet; after that, ownership changes are made in ELOS so handovers stay recorded. A single word is read as a team (
Payments); a name with a space as a person (Priya Raman). - No file. ELOS falls back to the repository's CODEOWNERS (
.github/CODEOWNERS,CODEOWNERSordocs/CODEOWNERS): the owner of the catch-all*rule, else the first rule. With neither, the service is flagged as an orphan. - Docs. The repository's
README.md,docs/README.md,docs/runbook.mdorRUNBOOK.mdis indexed as knowledge linked to the service, so Ask ELOS can cite it. - What's skipped. Forks aren't services. Archived repositories are listed but their files aren't read.
Roll it out across many repositories
Adding the file is a normal change in each repository. To add a starter file everywhere at once, script it with your source-control CLI and open one pull request per repository for its owners to review and complete. Start with your tier-1 services.
Keep it current
Connecting runs the first sync. To re-read your repositories on a schedule, start a recurring sync through the API (default every hour). Each run records one Synced integration entry in the audit log, and a service is only updated when something actually changed.
curl -sS -X POST "$ELOS_API/v1/integrations/github/sync/schedule" \
-H "Authorization: Bearer $ELOS_KEY" -H "Content-Type: application/json" \
--data '{"intervalSeconds": 3600}'Live repository events, so new repositories appear within seconds, are set up with our team.
What's next
- Use the ELOS API: Authenticate scripts with a service account key, page through results, retry safely and stay within rate limits.