TExcelTAD
Home › Platform Engineering: Internal Developer Platforms › The Software Catalog: catalog-info.yaml

The Software Catalog: catalog-info.yaml

The catalog is the heart of a portal: a database of everything engineering owns (services, websites, libraries, APIs, databases, teams) and how they relate. In Backstage, each entity is described by a small YAML file that lives next to the code it describes, usually catalog-info.yaml at the repository root. The portal discovers and reads those files; it doesn't own the data, Git does.

An entity file

Entities look like Kubernetes objects on purpose: apiVersion, kind, metadata, spec. Here is linkly's file:

yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: linkly
  title: linkly link shortener
  description: Shortens URLs and redirects; Go, PostgreSQL, Redis.
  tags: [go, http]
  links:
    - url: https://grafana.example.com/d/linkly
      title: Dashboard
  annotations:
    github.com/project-slug: acme/linkly
    backstage.io/techdocs-ref: dir:.
    backstage.io/kubernetes-id: linkly
spec:
  type: service
  lifecycle: production
  owner: group:team-links
  system: links
  providesApis: [linkly-api]
  dependsOn:
    - resource:linkly-db
    - resource:linkly-cache
Field Meaning
metadata.name unique within kind and namespace; letters and digits, optionally separated by -, _ or ., at most 63 characters (use lowercase with - to match Kubernetes and DNS)
metadata.annotations machine-readable links to other systems; plugins read them (the repo, docs location, Kubernetes label selector)
spec.type free-form but standardise it: service, website, library
spec.lifecycle experimental, production, deprecated (Backstage's well-known values)
spec.owner an entity reference to a Group (or User): who to call
spec.system, providesApis, dependsOn relations to other entities

Entity references have the form [kind:][namespace/]name. group:team-links is short for group:default/team-links; the kind can be left out where it's implied (an owner defaults to Group).

The kinds

Kind Describes Required spec fields
Component a piece of software: service, website, library type, lifecycle, owner
API an interface a component provides: OpenAPI, AsyncAPI, gRPC, GraphQL type, lifecycle, owner, definition
Resource infrastructure a component needs: database, bucket, queue type, owner
System a group of components, APIs and resources that form one product owner
Domain a group of systems in one business area owner
Group, User the organisation; usually imported from your identity provider Group: type, children
Template a software template (scaffolder) see Software Templates
Location a pointer to more entity files targets or target

A System and its API, in the same file (YAML multi-document) or separate ones:

yaml
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: links
spec:
  owner: team-links
  domain: sharing
---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
  name: linkly-api
spec:
  type: openapi
  lifecycle: production
  owner: team-links
  system: links
  definition:
    $text: ./openapi.yaml

$text reads the definition from a file next to the entity; there are also $json and $yaml substitutions.

How entities get in

Method How Good for
Register a URL the portal UI or the API: "register https://github.com/acme/linkly/blob/main/catalog-info.yaml" trying things out
Static locations catalog.locations in app-config.yaml the org file, templates
Discovery providers e.g. the GitHub provider scans an organisation for catalog-info.yaml files on a schedule production: every new repo appears automatically
Ingestion from other systems providers for your identity provider (users and groups), cloud accounts, Kubernetes data that shouldn't be hand-written

Backstage re-reads every location periodically and keeps the catalog in sync with Git, a reconcile loop like the ones in GitOps. Edit the YAML, merge, and the portal updates.

Querying catalog files offline

Catalog files are plain YAML, so you can answer many questions in CI or on a laptop without the portal. The session collects the entity files of three repositories into one stream and queries it with yq:

bash · try it yourself
mkdir -p repos/linkly repos/analytics repos/org
cat > repos/linkly/catalog-info.yaml <<'EOF'
apiVersion: backstage.io/v1alpha1
kind: Component
metadata: {name: linkly}
spec: {type: service, lifecycle: production, owner: team-links, system: links,
       dependsOn: [resource:linkly-db]}
---
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata: {name: linkly-db}
spec: {type: database, owner: team-links, system: links}
EOF
cat > repos/analytics/catalog-info.yaml <<'EOF'
apiVersion: backstage.io/v1alpha1
kind: Component
metadata: {name: analytics}
spec: {type: service, lifecycle: experimental, owner: team-growth,
       dependsOn: [resource:linkly-db]}
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata: {name: link-preview}
spec: {type: website, lifecycle: deprecated, owner: team-growth, system: links}
EOF
cat > repos/org/org.yaml <<'EOF'
apiVersion: backstage.io/v1alpha1
kind: Group
metadata: {name: team-links}
spec: {type: team, children: []}
---
apiVersion: backstage.io/v1alpha1
kind: Group
metadata: {name: team-growth}
spec: {type: team, children: []}
EOF
find repos -name '*.yaml' | sort | xargs yq ea '.' > catalog.yaml
echo "entities by kind:"
yq -N '.kind' catalog.yaml | sort | uniq -c
echo "components and owners:"
yq -N 'select(.kind == "Component") | .metadata.name + " -> " + .spec.owner + " (" + .spec.lifecycle + ")"' catalog.yaml
echo "components without a system:"
yq -N 'select(.kind == "Component" and .spec.system == null) | .metadata.name' catalog.yaml
echo "who depends on linkly-db:"
yq -N 'select(.spec.dependsOn[] == "resource:linkly-db") | .metadata.name' catalog.yaml
entities by kind:
      3 Component
      2 Group
      1 Resource
components and owners:
analytics -> team-growth (experimental)
link-preview -> team-growth (deprecated)
linkly -> team-links (production)
components without a system:
analytics
who depends on linkly-db:
analytics
linkly

Two findings a catalog review would raise: analytics belongs to no system, and another team's service depends directly on linkly's database, a hidden coupling that the next lesson makes visible as a graph.

Test yourself

Where does a Backstage component's catalog-info.yaml normally live?

  1. In the Backstage database only
  2. At the root of the component's own repository, next to the code
  3. In a central wiki
  4. In the Kubernetes cluster

Which spec fields are required for a Component?

  1. name and owner
  2. type, lifecycle and owner
  3. system and domain
  4. definition

What does the entity reference group:team-links expand to?

  1. user:team-links
  2. group:default/team-links
  3. component:team-links
  4. team-links/default