- Status: Proposed
- Deciders: mimotej, SamoKopecky, tumido
- Date: 2022-07-26
Backstage offers multiple entity types which can be used to represent entities and their relations in a service catalog. We need to have a set of rules present in Operate First that will provide context and guidance on how entities are mapped to Backstage resources.
- Easy and clear guidelines and distinction for each resource type.
- Supports various caveats like ODH meta operators and Cluster as a service/resource.
Backstage provides numerous resource types, which has strictly defined relations.
erDiagram
Domain ||--o{ System : contains
System ||--o{ Component : contains
Component |o--o{ Component : hasSubcomponent
Component |o--o{ Component : dependsOn
Component ||--o{ Resource : requires
Component ||--o{ API : provides
Component }|--|| API : consumes
Resource ||--o{ Component : dependsOn
Resource ||--o{ Resource : dependsOn
Location
Template
Group |o--|{ User : hasMember
Group |o--|{ Group : hasMember
Relations are generated from resource manifests. Extensive documentation on all supported and recognized relations is available upstream.
Additionally:
Group
and User
resources own any other resource type. All resources except Group
, User
and Location
is required to have an owner specified.
This entity represents a top-level non-root entity within the cloud. Think of it as a SIG type of entity. A whole collection of applications or group of services that are meant to work together and be used together.
Examples:
- SRE Domain: Contains all monitoring applications, CI/CD etc, Service Catalog, etc.
- Data Science Domain: Contains ODH and, Kubeflow, Data cataloging solutions and other analytics tools.
- Thoth Station Domain: All Thoth related systems including repository storages like Pulp, everything supporting Thoth.
Domain
owns multiple System
s.
System means a collection of applications and components that build a singular service. A system is meant as an interaction point for users as an application.
Examples:
- Service Catalog System: Represents Backstage as a whole.
- ODH System: Represents ODH as a collection of its components.
- ArgoCD System
- Prow System: Contains all Prow components like Deck, Crier, Horologium, etc.
System
resource belongs to a one domain. System
resource owns Component
resources.
If there are multiple instances of the same service system, either for different maturity level environments (staging/production) or intended to different audiences (ODH in Smaug and ODH in OS Climate) the System or Component resources need to be duplicated.
Individual service, a runtime, component. Usually describes an individual kubernetes Deployment
. Component
kind is the most feature rich entity in Backstage, it allows you to track CI/CD, Kubernetes deployment, Grafana dashboards etc. That means Component
kind should be used for each individual piece of code base, both home grown and external, that is packaged either as a library, dependency, OCI container and so on.
Examples:
- ArgoCD Repository Server Component
- Deck Component of Prow
In special cases of complicated architectures, where there are multiple entities in between a Domain
, System
and a deployment, the Component
resource can describe a "System-like" resources. The most obvious example here is applications which belong to Open Data Hub:
Open Data Hub is described as a
System
resource in Data ScienceDomain
. Due to lack of intermediate resource types in Backstage, all the applications within Open Data Hub, like Superset, JupyterHub, Argo Workflows, etc. are described asComponent
resources. These resources have subcomponents (specified asComponent
resources with the.spec.subcomponentOf
field specified) which finally map to individual deployments
- JupyterHub Component
- JupyterHub Controller subcomponent
Component
resource - Idle culler subcomponent
Component
resource
The Component
resource requires a .spec.type
field to be specified. While any arbitrary value is allowed here, we recognize following main types:
service
: Any backend-like application, API provider, botwebsite
: Has to provide frontend web interfacelibrary
: Provides a library or any sort of code base dependencytemplate
: Is used as a repository or service template
If a component is a backend service, it may expose an API intended to be consumed by others. Each exposed API should provide an definition, either statically or dynamically. Backstage requires us to specify .spec.definition
and .spec.type
fields. Definition should reflect selected type. Additionally .spec.definition
can directly describe the API verbatim or can reference remote or service provided dynamic API definitions through supported substitution modifiers.
This resource type represents any other type of dependency of a Component
. It can be an object bucket, a cluster where the workload is hosted at, etc. Any external dependency that the service relies on. This entity type describes a concrete resource - a specific database cluster, a named S3 bucket and external SaaS/PaaS out of Operate First control.
Represents individual users.
Represents group of users or teams. Composable unit of organization and people structure. Groups should represent individual service owners and contact points.
In Backstage this is used for interactive forms. Since all our configuration is declarative, we don't plan on using this entity.
Backstage provides this entity type to allow you to extend catalog from other locations. Since our catalog is co-located in a single place, we don't plan on using this entity to reference external locations. Please refrain from creating new Location
s, instead extend the ones available at service catalog manifests folder root.
Each entity is required to feature .metadata.name
by definition. Additionally it is advised to provide additional details via:
.metadata.title
for a display name.metadata.description
for human readable description of the entity
Individual entity types support various annotations, which allow users to enable certain plugins and features. To understand supported annotations, users should refer to our service catalog documentation and upstream documentation on annotations.
All entity types support tagging. While any arbitrary value is allowed, it's better to restrict ourselves so we can use these values for easy filtering and search. Please be considered when using tags and don't be overly specific (unique tag applied to a single resource only is not helpful).
Additionally you can display links for each entity. Please use them to point to additional documentation, repositories and other resources. See specification for more details.
In order to understand the mapping better, illustrate it on following well known services:
flowchart LR
a[SRE Domain] --> b[Service Catalog System]
b --> c[Backstage Component]
c -- dependsOn --> d[S3 bucket Resource]
c -- dependsOn --> e[Smaug cluster Resource]
c -- dependsOn --> f[PG Cluster Resource]
c -- consumesApi --> u
c -- implements --> g[Backstage API]
a --> h[ArgoCD System]
h --> i[Repo server Component]
h --> j[ArgoCD Server Component]
j -- implements --> u[ArgoCD API]
h --> k[Redis Component]
i -- dependsOn --> l[Infra cluster Resource]
j -- dependsOn --> l
k -- dependsOn --> l
m[Data Science Domain] --> n[ODH System]
n --> o[Argo Workflows Component]
n --> p[ODH Dashboard Component]
n --> q[JupyterHub Component]
q --> r[Jupyterhub SubComponent]
q --> s[Jupyterhub DB SubComponent]
q --> t[Idle culler SubComponent]
r -- dependsOn --> e
s -- dependsOn --> e
t -- dependsOn --> e