# Kubernetes runtime charts

> Five charts of how OpenLakeForge runs on Kubernetes: every pod, how the services talk to each other, the short-lived jobs of a pipeline run, the medallion…

Source: https://openlakeforge.dev/docs/architecture/diagrams/

Five charts of how OpenLakeForge runs on Kubernetes: every pod, how the services
talk to each other, the short-lived jobs of a pipeline run, the medallion data
path through the catalog, and the provider contracts that let the same platform
run on kind, EKS and AKS.

They use the official Kubernetes icon language and complement the
[Architecture](https://openlakeforge.dev/docs/architecture/overview/) page, which shows *what* the platform does; these
show *how* it runs.

| **31** | **1+N** | **3** | **0** |
| --- | --- | --- | --- |
| pods at steady state — Full preset, DEV + PROD, identity on: 24 Deployments, 7 StatefulSets | nested ephemeral Kubernetes Jobs per ingestion run — one run pod, one Floe Job per domain | deployment targets sharing one contract — kind, AKS, EKS | run/Floe pods between runs (Gold runs in Trino) |

### Reading key — used identically in every chart

| Signal | Means |
| --- | --- |
| Blue heptagon icon | Kubernetes workload — the badge names the kind (`deploy`, `sts`, `svc`, `secret`) |
| **Purple icon / dashed purple border** | **On-demand Job or CronJob** — created by something other than a Deployment, and never counted in the 20 |
| Green box | Long-lived service, grouped by Helm release |
| Blue box / badge | Control plane — Terraform, contracts, `olf` |
| Cylinder | Bucket or datastore; bronze / grey / amber follow the medallion layers |
| Orange | Managed service (AWS adapters) |

> Purple splits three ways by **what creates the Job**, which is also how chart 1 groups
> them. *Per pipeline run*: Dagster's `K8sRunLauncher` creates the run pod, which creates
> one Floe Job per domain — both TTL-collected within the hour, so the pipeline scales
> to zero between runs. *Bootstrap*: for one full stage, four Terraform
> `kubernetes_job_v1` resource blocks (Polaris's metastore, OpenMetadata's Fernet key,
> PostgreSQL, SeaweedFS) plus two Helm hooks (Superset's init, cert-manager's startup
> API check) — the SeaweedFS block uses `for_each` over four bucket names, so it alone
> creates four Jobs, for nine Jobs total. Terraform's Jobs and Superset's hook run per platform
> apply; cert-manager's hook is `post-install` only, so it runs on the first apply. The
> Helm hooks are deleted on success and the rest persist until the next apply.
> *Scheduled*: two `kubernetes_cron_job_v1`
> resources on the cluster clock (log-archive every 15 min keeping 1 succeeded / 3 failed,
> OM catalog refresh hourly keeping 3 / 3), plus OpenMetadata's ingestion pipelines, which
> its own scheduler creates — not Terraform, and not Dagster.

---

## Chart 1 — Cluster Pod Census

*Every pod across the deployment's namespaces, grouped by service — counted from this repo's Terraform
modules and Helm values (`infra/terraform/environments/local/main.tf`, `infra/helm/values/local/`).*

Thirty pods run at steady state for the Full preset with DEV and PROD and
`spec.identity` set (the shape of `openlakeforge.conformance.yaml`). Per stage,
Dagster runs three (webserver, daemon, and the merged `openlakeforge-dagster`
code server loading `lakehouse_code.definitions`) and Superset runs three (node,
worker and Redis); the Dagster and Superset modules are instantiated once per
enabled stage and per stage with analytics (`for_each` in
`infra/terraform/environments/local/main.tf`), so DEV and PROD give 6 + 6.
Trino runs one coordinator per stage (`olf-<stage>`, #965), so DEV and PROD give 2;
it is deliberately coordinator-only at the default `spec.query.size`, and each
`small` coordinator requests 500m CPU and 2Gi (limit 4Gi, `release/query-sizes.yaml`),
so the second one adds that much to the stack's requests. Shared, SeaweedFS runs
four (three StatefulSets and an S3-gateway Deployment), OpenMetadata two, and
PostgreSQL and Polaris one each. The ingress adds
five single-replica Deployments in `olf-system`: Traefik, the cert-manager
controller, cainjector, and webhook, and the portal, which serves the landing
page at the base domain. With `spec.identity` the identity row adds four more:
Dex, one oauth2-proxy per distinct role floor (two: `viewer` and
`data-engineer`, from `release/identity-roles.yaml`) and the platform API,
answering `/api` on the base domain. The icons show one stage's Dagster and
Superset pods; a profile with fewer stages, no analytics or governance, or no ingress or identity runs fewer.

The purple band underneath is everything that is *not* in that 30, split by what creates
it. **Per pipeline run**: the run pod and its Floe Jobs, TTL-collected within the hour,
so ingestion scales to zero between runs — Gold is the exception, running as SQL inside
the long-lived Trino coordinator above rather than in a Job. **Bootstrap**: six grouped
categories — Polaris (its metastore; `olf` bootstraps the catalogs and principals
after the apply, with no Job), SeaweedFS (one Job per bucket, four buckets),
PostgreSQL, OpenMetadata (its Fernet key; `olf` bootstraps OpenMetadata after the
apply, with no Job), Superset's Helm hook, and cert-manager's startup API check hook
— nine one-shot Jobs for one full stage, firing once per platform
apply (phase 2), except cert-manager's check, which runs only on first install.
**Scheduled**: the two CronJobs on the cluster clock (log archive every 15 minutes,
OpenMetadata catalog refresh hourly).

![Cluster Pod Census](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart1-cluster-pod-census.svg)

<sub>`infra/helm/values/local/*.yaml` · orchestration/dagster + storage/postgresql +
governance/openmetadata + access/{traefik,cert-manager,portal} Terraform modules</sub>

## Chart 2 — Namespace Runtime Topology

*What talks to what — the service DNS on the wires is what consumers actually read from
the contracts.*

Superset queries Trino; Trino resolves tables through Polaris and reads data over s3a;
Polaris persists catalog state in PostgreSQL through JDBC, so a plain pod restart
preserves catalog and table identity. Polaris points at the Iceberg warehouse files in
SeaweedFS; Dagster, OpenMetadata, Superset, and Polaris share one PostgreSQL service.
The per-run pair does the data work: the run pod lands raw data in
object storage with **dlt**, launches a **Floe** Job per domain (which authenticates to
Polaris and reads/writes SeaweedFS), then calls **Trino** through dbt-trino to build
Gold. Both Floe and dbt-trino also push OpenLineage events straight to OpenMetadata's
native endpoint — that lineage ingestion was restored, not deferred.

![Namespace Runtime Topology](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart2-namespace-topology.svg)

<sub>[docs/architecture/local-stack-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/local-stack-contracts.md) · `infra/terraform/modules/**`</sub>

## Chart 3 — Ephemeral Job Lifecycle

*Launch → run pod → one Floe Job per domain → Gold via Trino → everything garbage-collected.*

The differentiating behavior: the Dagster run pod is itself an ephemeral Job, and it
creates **one Floe Job per domain** on the same project-code image, which validates
the domain's selected entities one after another — so `order_revenue`, whose six Silver
inputs all belong to domain `sales`, runs one Floe Job per pipeline run. Silver memory is
bounded by that Job, not the run pod; failures isolate per domain; TTL returns the per-run
footprint to zero (Gold SQL executes in the standing Trino service, not a per-run pod).

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="/docs-assets/docs/assets/chart3-ephemeral-job-lifecycle-dark.svg">
  <img alt="Ephemeral job lifecycle: the user launches a product job in Dagster; the daemon creates the run pod, which lands Bronze with dlt, creates one Floe Job per domain, which validates the domain's entities in sequence and commits Silver through the catalog, then runs dbt-trino so Trino builds Gold; every run and Floe pod is garbage-collected after the run" src="https://openlakeforge.dev/docs-assets/docs/assets/chart3-ephemeral-job-lifecycle-light.svg">
</picture>

> Observe it live: `kubectl -n olf-dev get jobs -w` — the run Job appears, then one
> Floe Job per domain while it is still Running, then all of them vanish an hour later.

Full detail — the per-engine execution table and the Job state machine — is in
**[chart3-ephemeral-job-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/diagrams/chart3-ephemeral-job-lifecycle.md)**.

## Chart 4 — Medallion & Catalog Data Path

*Bucket = lane, and the Iceberg catalog governs Silver and Gold — one product traced end
to end.*

Raw data lands in Bronze as-is via dlt (CSV in the seed products, any raw source); the
domain's Floe Job validates it against the contract and commits Silver Iceberg tables
through the catalog; dbt builds the Gold marts with the SQL executing **in Trino**
(dbt-trino). The catalog — Polaris locally, AWS Glue on the AWS POC — spans both curated
layers: per-product namespaces, allowed locations, and every write committed through it,
never to raw paths. Rejected rows are quarantined as CSV; exit code 0 covers
`success_or_rejected`.

![Medallion and Catalog Data Path](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart4-medallion-catalog.svg)

<sub>environments/local/main.tf · catalog/polaris/main.tf · lakehouse_code/governance.yml · ADR 0003, 0004</sub>

## Chart 5 — Provider Contracts

*Engines consume interfaces, never implementations — swap the adapters, keep the
engines.*

The modularity chart. The engines across the top are byte-identical in every deployment.
Provider-contract v3 supplies shared platform bindings plus a selected stage's endpoint,
storage, catalog, and identity bindings. The matrix records the stable capability fields
(`catalog_type`, buckets, Secret references) and the adapter selected in each target.
Every root (local, AWS, Azure) emits this v3 shape, with one stage entry per enabled
stage.

Cell colour is the argument: grey means the module is the same one `local` uses, orange
means it was swapped. **`azure-poc` instantiates the same seven platform modules as
`local`** — SeaweedFS, Polaris, PostgreSQL, Trino, OpenMetadata, Superset, Dagster all
reuse the identical modules — and `contracts.tf` pins that with a `check
"azure_poc_keeps_s3_compatible_storage"` block. But the foundation root (AKS vs kind),
artifact registry (ACR vs kind image load), and identity adapter (AKS OIDC-ready vs local
dev credentials) do differ from the foundation's perspective; since the matrix groups
artifacts and foundation together, two Azure cells appear orange. `aws-poc` swaps a
different set: exactly three platform modules (`storage/aws-s3`, `catalog/aws-glue`,
`storage/rds-postgresql`) and reuses Trino, OpenMetadata, Superset, Dagster.

![Provider Contracts](https://openlakeforge.dev/docs-assets/docs/architecture/diagrams/chart5-provider-contracts.svg)

<sub>`infra/terraform/environments/{local,aws-poc,azure-poc}/contracts.tf` · [provider-contracts.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/provider-contracts.md) · ADR 0003, 0010</sub>

---

# Reference tables

*Comparisons and inventories — content that reads better as tables than as boxes.*

## Provider portability

| Contract | Local | Azure POC | AWS POC |
| --- | --- | --- | --- |
| Foundation | kind, 1 control-plane + 2 workers | AKS + ACR | VPC + EKS + node group + ECR |
| Object storage | SeaweedFS in-cluster | SeaweedFS on AKS | **S3** |
| Metadata database | PostgreSQL in-cluster | PostgreSQL in-cluster | **RDS PostgreSQL** |
| Iceberg catalog | Polaris REST | Polaris REST | **AWS Glue** |
| Container registry | kind image load | ACR | ECR |
| Workload identity | Kubernetes service account | AKS OIDC readiness | **EKS Pod Identity** — no static keys |
| Query + Gold engine | Trino | Trino | Trino |

`catalog_type` is the one field consumers branch on: `rest` selects the Polaris runtime
profile, `glue` the native Glue profile. Naming stays stable across Glue's two-level
model, so SQL and dbt models are unchanged. Not implemented (declared future adapters):
Vault/External Secrets, Athena, Lake Formation and remote Terraform state.
Traefik, cert-manager and the Dex identity issuer run on the local profile only
(ADR 0013, ADR 0014); AWS and Azure still use port-forward. OpenLineage is live, not deferred — Floe and dbt-trino emit lineage
events directly to OpenMetadata's native `openlineage` endpoint. The governance bootstrap
creates the endpoint credentials; runners receive them only through Secret references.
[ADR 0007](https://openlakeforge.dev/docs/adr/0007-governance-and-lineage/) covers the full history:
a normalising proxy first hid upstream correctness problems, lineage was then
deferred while those were fixed, and native emission was restored once Floe
and dbt-trino could target OpenMetadata's endpoint directly. The proxy and a
custom REST push both remain rejected.

## Three phases, one CD boundary

`olf infra deploy` runs three ordered phases: **foundation** (the cluster and
registry), **platform** (Terraform-managed services), then **artifacts**
(everything derived from `lakehouse_code/`). The CD boundary is not "foundation
is outside, the rest is the deploy" — it is the static/dynamic split between
platform and artifacts. A domain commit triggers the artifacts phase only; CI
never runs Terraform for a domain change ([ADR 0002](https://openlakeforge.dev/docs/adr/0002-deployment-lifecycle/)).

| Phase | Target | Deploys |
| --- | --- | --- |
| 1 — Foundation | `olf infra deploy --provider local --phase foundation` | Terraform: the Kubernetes cluster + container registry — kind locally, EKS + ECR on AWS, AKS + ACR on Azure |
| 2 — Platform | `olf infra deploy --provider local --phase platform` | Terraform-managed platform resources: Helm releases for SeaweedFS, Polaris, Trino, OpenMetadata, Superset, Dagster — plus PostgreSQL, which Terraform creates directly as a StatefulSet + Service + bootstrap Job (no Helm release) |
| 3 — Artifacts | `olf infra deploy --provider local --phase artifacts` | **the CD phase** — dynamic artifacts: catalog namespaces, the project-code image (Dagster definitions, Floe contracts, dbt code), Superset dashboards, OpenMetadata data products |

Phases 1 and 2 are static infrastructure that Terraform owns; phase 3 is
dynamic and code-derived. `olf infra deploy --provider local` with no `--phase` chains
1 → 2 → 3; phases 1 and 2 are idempotent no-ops when nothing changed. Phase 3,
in order: build + push (or, with no repository of its own, build + load) `project-code`
and publish its ProjectRevision → `deploy_revision`, which runs `olf infra catalog sync-namespaces` →
`olf infra report import` (analytics layer on) → `olf infra openmetadata deploy-metadata` (governance
layer on) → the Dagster rollout of the `openlakeforge-project` release, which carries the
run launcher's image, every code location, and the log-archive CronJob. The Floe contracts ship inside the project-code image; nothing
Floe-specific is compiled or uploaded.
CI validates structure, infrastructure, contracts, project-code, tooling, dbt, and
release readiness; pull requests also run the bounded slim kind smoke.

## Identity — one principal per engine

| Principal | Secret | Roles |
| --- | --- | --- |
| olf-\<stage\>-processing (dbt through Trino, and Floe) | `polaris-<stage>-processing-creds` | processing-\<stage\> / catalog-processing |
| trino-catalog-\<stage\> (the stage Trino's catalogs) | `polaris-<stage>-trino-catalog-creds` | none: each query carries its caller's token |
| openmetadata | `polaris-om-creds` | data-reader / catalog-reader |
| (root) | `polaris-bootstrap-credentials` | the metastore Job and `olf`'s bootstrap only |

dbt has **no** Polaris principal — the bootstrap deletes the old `polaris-dbt-creds`;
Gold SQL runs in Trino, so Gold catalog access uses the processing credential. Plus
`seaweedfs-s3-creds` for object storage. A leaked writer credential cannot
administer the catalog. Delivery is Terraform → Kubernetes Secret →
`envSecrets`/`envFrom` into long-lived pods *and* ephemeral Jobs; the Trino catalog file
holds `${ENV:...}` placeholders, never literal secrets. The AWS POC replaces static
storage keys entirely with EKS Pod Identity
([ADR 0010](https://openlakeforge.dev/docs/adr/0010-cloud-provider-implementations/)).

## Observability — object storage is the sink

No Loki/Grafana/Prometheus in v1 (`observability.object_log_archive`). Ephemeral pods
are deleted on TTL; their evidence is not:

```text
s3://openlakeforge-ops/
├── project/revisions/sha256/{digest}/                          ← olf infra project build
└── activations/{stage}/
    ├── floe/reports/{domain}/run_{id}/                         ← the domain's Floe Job
    ├── logs/dagster/compute/                                   ← S3ComputeLogManager
    ├── logs/k8s/namespace={ns}/date={YYYY-MM-DD}/hour={HH}/    ← log-archive CronJob
    └── run-artifacts/dbt/{domain}/{product}/{dagster_run_id}/  ← run pod, post-dbt-build
```

The dbt run-artifacts are keyed by Dagster run ID (`run-artifacts/dbt/{domain}/
{product}/{dagster_run_id}/`) and each Floe Job writes its reports under its own
`floe/reports/{domain}/run_{id}/` (the project's `report.path` beneath the stage's
artifact prefix, `openlakeforge_runtime/floe_profile.py`), so both stay isolable per run after the pods
are gone. The archived Kubernetes pod logs are partitioned only by namespace / date /
hour (`openlakeforge_runtime/k8s_log_archive.py`), so isolating a single run from raw pod logs needs a
timestamp, not just a prefix.

## Medallion-oriented code structure — the dynamic code

Everything in Phase ③ is **user code under `lakehouse_code/`**, and nothing about the
platform changes when a source, domain, or product is added. This is the "dynamic" half
of the platform (the artifacts phase); the charts above are the static half. Unlike the
earlier layout, ownership is no longer domain-vertical: Bronze is source-owned,
Silver is domain-owned, Gold is product-owned, dashboards are consumption-owned, and each
concern still maps to exactly one engine:

```text
lakehouse_code/
├── governance.yml                            ← governance:      domain · data-product metadata           → OpenMetadata
├── definitions.py                            ← pipeline entry:  the Dagster Definitions the code server loads
├── bronze/<source>/                          ← source-owned
│   ├── source.yaml                                              resource inventory
│   └── dlt/<source>.py                       ← extract:         raw source → Bronze                      → dlt
├── silver/                                   ← the Floe project: floe.yml · sources.yml
│   └── <domain>/                             ← domain-owned
│       ├── domain.yml                        ← contract:        domain defaults · sinks · reject policy  → Floe
│       └── contracts/<entity>.yml                               one per entity: schema · PK
├── gold/                                     ← the Gold dbt project: dbt_project.yml · packages.yml · macros/
│   └── models/
│       ├── _sources/<domain>.yml                                 each domain's Silver, declared once
│       └── <product>/                        ← product-owned:   *.sql · schema.yml  Silver→Gold SQL       → dbt-trino → Trino
├── pipelines/dagster/<product>.py            ← pipeline:        asset graph wiring bronze→floe→dbt        → Dagster
├── dashboards/superset/<dashboard>/          ← consumption-owned
│   └── metadata.yaml                                             charts · dashboards · datasets · databases → Superset
└── bronze/<source>/examples/*.csv                                seed data for the local demo
```

Two products can share one source-owned Bronze asset and one domain-owned Silver asset
without duplicating ingestion: `sales` (`order_revenue`, `customer_health`) uses one
`crm/accounts` asset and one `sales/accounts` asset, while `supply_chain`
(`inventory_reliability`) consumes `erp`. Adding a data product changes only its bronze,
silver, gold, dashboard, and pipeline slices, then runs the artifact phase.
`olf infra catalog sync-namespaces` derives the Silver and Gold namespaces from
`governance.yml` (a domain owns `<domain>_silver`, a product
`<product>_gold`; Bronze has no namespace, only files in the Bronze bucket) and reconciles them before Floe, dbt, or OpenMetadata use them. A new product, domain, or source therefore needs no environment
Terraform edit or platform apply; see ADR 0002 and ADR 0004. `lakehouse_code/governance.yml`
is the canonical, human- and machine-readable descriptor of every domain and product.

---

**About these charts.** Charts 1, 2, 4, 5 are self-contained SVGs (official CNCF
Kubernetes icons embedded, no external references) generated by the Python sources in
[src/](https://github.com/OpenLakeForge/openlakeforge/tree/v0.6.0-alpha.3/docs/architecture/diagrams/src/) — regenerate with `python3 docs/architecture/diagrams/src/spec_chartN.py`. Chart 3 is the Mermaid
sequence diagram in
[chart3-ephemeral-job-lifecycle.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/docs/architecture/diagrams/chart3-ephemeral-job-lifecycle.md), rendered
to the light and dark SVGs in `docs/assets/` with `@mermaid-js/mermaid-cli`
11.4.2; the dark copy swaps the three box tints for dark ones. Every count and
identifier is traceable to a cited source file; nothing aspirational is drawn as
existing.

---

<small>Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/architecture/diagrams.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/architecture/diagrams.md).</small>
