Skip to content

Commit 4bdd290

Browse files
committed
feat: register DNS in the service catalog
Add a service-catalog Kustomize component that publishes the DNS Service resource (services.miloapis.com/v1alpha1) into the Milo catalog. Establishes identity (serviceName dns.networking.miloapis.com), display metadata, and producer owner, in phase Published. This is Phase 1 of #44 (service registration). The ServiceConfiguration that declares DNS metering is left as a stubbed slot for Phase 2. The bundle is deployed into the services-operator namespace by Flux from infra, not by the operator overlays.
1 parent f3fb3eb commit 4bdd290

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Service catalog
2+
3+
DNS's catalog identifiers — everything the services-operator and
4+
downstream Milo controllers need in order to recognise DNS as a
5+
billable service.
6+
7+
Concrete `Service` + `ServiceConfiguration` registrations are
8+
deployable artefacts that the producing service publishes as part of
9+
its own deployment process, so they live here in `dns-operator` rather
10+
than in the [`datum-cloud/services`](https://github.com/datum-cloud/services)
11+
API-surface repo.
12+
13+
## Contents
14+
15+
| Kind | Name | What it declares |
16+
| ---------------------- | ----------------------------- | --------------------------------------------------------------------------- |
17+
| `Service` | `dns-networking-miloapis-com` | `serviceName`, display metadata, producer owner. |
18+
| `ServiceConfiguration` | `dns-networking-miloapis-com` | DNS MonitoredResourceTypes, metrics, and billing routing. _(Phase 2 — TBD)_ |
19+
20+
Ships in `phase: Published`.
21+
22+
## Identity
23+
24+
- **`serviceName`: `dns.networking.miloapis.com`** — the canonical
25+
reverse-DNS identifier, matching the DNS API group. It is the
26+
cross-system join key used by `MeterDefinition`,
27+
`MonitoredResourceType`, billing exports, and the portal. Immutable
28+
once Published.
29+
- **`metadata.name`: `dns-networking-miloapis-com`** — the Kubernetes
30+
slug (serviceName with dots replaced by dashes).
31+
32+
## Why a `ServiceConfiguration` instead of raw `MeterDefinition`s
33+
34+
The canonical producer-facing document for billing is
35+
`services.miloapis.com/v1alpha1.ServiceConfiguration` — see
36+
[`billing/docs/emitting-usage.md`](https://github.com/datum-cloud/billing/blob/main/docs/emitting-usage.md).
37+
A producer authors _one_ document; the services-operator fans it out
38+
into `billing.miloapis.com/MeterDefinition` and `MonitoredResourceType`
39+
objects stamped `app.kubernetes.io/managed-by: services-operator`.
40+
Producers must not author those downstream CRDs directly — edit the
41+
`ServiceConfiguration` and let the fan-out catch up.
42+
43+
The DNS `ServiceConfiguration` is tracked as Phase 2 of the catalog
44+
registration (metering): query volume, hosted zones, and record-set
45+
inventory. See the
46+
[catalog registration issue](https://github.com/datum-cloud/dns-operator/issues/44).
47+
48+
## Immutability after `Published`
49+
50+
- On `Service`: `spec.serviceName` is immutable. Display name and
51+
description may still evolve.
52+
- On `ServiceConfiguration` (once added): `spec.metrics[].name`,
53+
`.kind`, `.unit` and `spec.monitoredResourceTypes[].type`, `.gvk` are
54+
immutable. Renames or unit changes ship as a new metric name (e.g.
55+
`.../v2`).
56+
57+
## Deployment
58+
59+
This bundle is **not** applied by the operator deployment overlays
60+
(`config/agent`, `config/overlays/replicator`). It is deployed into the
61+
services-operator's namespace by Flux from the infra repo, the same way
62+
other services publish their catalog entries.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
6+
# Service catalog registration for the Datum Cloud DNS service.
7+
#
8+
# Authors the cluster-scoped documents the services-operator uses to
9+
# reason about DNS:
10+
#
11+
# 1. The `Service` itself (`dns-networking-miloapis-com`), which carries
12+
# identity (`serviceName`), display metadata, and producer owner.
13+
# (Phase 1 — service registration.)
14+
# 2. A single `ServiceConfiguration` (same name, different Kind) that
15+
# will declare the DNS MonitoredResourceTypes, metrics, and billing
16+
# routing. (Phase 2 — metering; not yet authored.)
17+
#
18+
# Per billing's `emitting-usage.md`, the `ServiceConfiguration` is the
19+
# *only* document a producer authors for billing: the services-operator
20+
# fans it out into `billing.miloapis.com/MeterDefinition` and
21+
# `MonitoredResourceType` objects stamped
22+
# `app.kubernetes.io/managed-by: services-operator`. Do not author those
23+
# directly.
24+
#
25+
# This bundle is NOT applied by the operator deployment overlays. It is
26+
# deployed into the services-operator's namespace by Flux from the infra
27+
# repo, the same way other services publish their catalog entries.
28+
resources:
29+
- services_v1alpha1_service_dns.yaml
30+
# - services_v1alpha1_serviceconfiguration_dns.yaml # added in Phase 2
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
3+
apiVersion: services.miloapis.com/v1alpha1
4+
kind: Service
5+
metadata:
6+
labels:
7+
app.kubernetes.io/name: dns-operator
8+
app.kubernetes.io/managed-by: kustomize
9+
name: dns-networking-miloapis-com
10+
spec:
11+
serviceName: dns.networking.miloapis.com
12+
phase: Published
13+
displayName: DNS
14+
description: |
15+
Managed authoritative DNS for Datum Cloud. Model zones, record sets,
16+
and zone classes as Kubernetes resources and have them programmed
17+
into a DNS backend (PowerDNS). Billed via the
18+
dns.networking.miloapis.com meter family declared by this service's
19+
ServiceConfiguration.
20+
owner:
21+
producerProjectRef:
22+
name: datum-cloud

0 commit comments

Comments
 (0)