Repository navigation
feat(helm): S3-native Helm chart for the RFC 0019 split topology #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e78975d
feat(helm): s3-native chart for the rfc 0019 split topology
jensholdgaard c95efb3
feat(helm): only the dedicated compactor sweeps via OURIOS_COMPACTION…
jensholdgaard ec3e6f0
fix(helm): quote the test-pod query, correct interval + NOTES guidance
jensholdgaard 4fda605
fix(helm): address pr #304 review — fail-fast guards, merged annotati…
jensholdgaard 2a427f5
fix(helm): cloud-agnostic framing + nil-safe IRSA, test-pod cleanup
jensholdgaard cb067f4
fix(helm): use S3-named OURIOS_S3_* credential Secret keys; pin busyb…
jensholdgaard d2bc70e
docs(helm): correct template/NOTES wording for the local default + cr…
jensholdgaard 2d9c297
fix(helm): fail render on an invalid backend; gate S3 creds on the s3…
jensholdgaard 73e5cef
fix(helm): fail render on non-positive querier window / compaction in…
jensholdgaard 4216c37
docs(helm): add the k8s topology diagram (mingrammer diagrams)
jensholdgaard 2c0a2ba
fix(helm): route diagram cred edges via workloads; ship PNG; guard IR…
jensholdgaard 27065b9
fix(helm): bound the helm-test pod (deadline + curl timeouts); clarif…
jensholdgaard 583e076
fix(helm): test both roles when both are enabled (split topology)
jensholdgaard 7f055ca
docs(helm): region is optional; querier reads the configured store (n…
jensholdgaard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ | ||
| # Chart-docs generator scripts — not shipped in the package. The rendered | ||
| # topology.png IS shipped so the README image resolves from the chart artifact | ||
| # (e.g. Artifact Hub). | ||
| docs/*.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| apiVersion: v2 | ||
| name: ourios | ||
| description: | | ||
| Ourios — a log storage and query backend on Apache Parquet, a Drain-derived | ||
| template miner, and Apache DataFusion. This chart deploys the single | ||
| `ourios-server` binary on S3-compatible object storage (RFC 0019; AWS S3 or | ||
| any S3-compatible provider): the OTLP receiver as a StatefulSet with a | ||
| per-replica WAL PVC, the querier as an independently scalable stateless | ||
| Deployment, and a singleton background compactor, all sharing the data + | ||
| audit store on object storage. | ||
| type: application | ||
| # Chart version — bumped on chart changes, independent of the app version. | ||
| version: 0.2.0 | ||
| # Tracks the ourios-server crate version (pre-release; no image is published | ||
| # for 0.0.0). Surfaces as the app.kubernetes.io/version label. The deployed | ||
| # image tag is set via image.tag (defaults to `latest`), not this field. | ||
| appVersion: "0.0.0" | ||
| keywords: | ||
| - logs | ||
| - observability | ||
| - opentelemetry | ||
| - parquet | ||
| - datafusion | ||
| home: https://github.com/jensholdgaard/ourios | ||
| sources: | ||
| - https://github.com/jensholdgaard/ourios | ||
| maintainers: | ||
| - name: Jens Holdgaard Pedersen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,200 @@ | ||
| # Ourios Helm chart | ||
|
|
||
| Deploys [Ourios](https://github.com/jensholdgaard/ourios) — a log storage and | ||
| query backend on Apache Parquet, a Drain-derived template miner, and Apache | ||
| DataFusion — backed by **S3-compatible object storage** (RFC 0019). | ||
|
|
||
| "S3" here means the S3 API, **not AWS specifically**: the store works with AWS | ||
| S3 and any S3-compatible provider — MinIO, Cloudflare R2, Hetzner Object | ||
| Storage, Ceph/RADOS Gateway, Google Cloud Storage via its S3 interop endpoint, | ||
| and so on. Point `storage.s3.endpoint` at a non-AWS provider (see | ||
| [Credentials](#credentials)). | ||
|
|
||
| Ourios is one binary (`ourios-server`) running three roles. This chart deploys | ||
| them as three workloads sharing a data + audit store on object storage: | ||
|
|
||
| - **receiver** — OTLP log ingest, a **StatefulSet** with a per-replica | ||
| write-ahead-log PVC; | ||
| - **querier** — the logs-DSL query API, a stateless **Deployment** that scales | ||
| independently and reads the store (no PVC); | ||
| - **compactor** — the always-on background compactor, a singleton | ||
| **Deployment**. | ||
|
|
||
| ## Topology | ||
|
|
||
|  | ||
|
|
||
| Diagram source: [`docs/topology.py`](docs/topology.py) (mingrammer | ||
| [`diagrams`](https://diagrams.mingrammer.com/), k8s node set) — shipped in the | ||
| **repo checkout** only; it is excluded from the packaged chart (`.helmignore`), | ||
| so the link above resolves on GitHub, not from a chart artifact. Regenerate from | ||
| a repo checkout with `python docs/topology.py` in this chart directory (or | ||
| `python deploy/helm/ourios/docs/topology.py` from the repo root; needs Graphviz + | ||
| `pip install diagrams`). A text fallback follows for terminal / `helm show readme`: | ||
|
|
||
| ``` | ||
| OTLP query | ||
| │ │ | ||
| ┌──────────▼──────────┐ ┌───────────▼───────────┐ | ||
| │ receiver StatefulSet │ │ querier Deployment │ | ||
| │ 4317/gRPC 4318/HTTP │ │ 4319/HTTP │ | ||
| │ WAL PVC per replica │ │ stateless (N replicas)│ | ||
| └──────────┬──────────┘ └───────────┬───────────┘ | ||
| │ Parquet write │ read | ||
| └──────────────┬──────────────┘ | ||
| ▼ | ||
| ┌───────────────────┐ ┌──────────────────────┐ | ||
| │ object store │◀───────│ compactor Deployment │ | ||
| │ (S3 API) │ sweep │ (1 replica) │ | ||
| │ (data/audit/man.) │ │ │ | ||
| └───────────────────┘ └──────────────────────┘ | ||
| ``` | ||
|
|
||
| Only the data/audit/manifest live on object storage. The **WAL is always a | ||
| local durable PVC, never object storage** (CLAUDE.md §3.4 WAL-before-ack / §3.6 | ||
| object storage is the source of truth). | ||
|
|
||
| ## Install | ||
|
|
||
| **S3 backend on AWS (production):** | ||
|
|
||
| ```sh | ||
| helm install ourios deploy/helm/ourios \ | ||
| --set image.tag=<release> \ | ||
| --set storage.backend=s3 \ | ||
| --set storage.s3.bucket=my-ourios-bucket \ | ||
| --set storage.s3.region=us-east-1 \ | ||
| --set storage.s3.existingSecret=ourios-s3 # OR use IRSA (see below) | ||
| ``` | ||
|
|
||
| **S3-compatible backend (MinIO / R2 / Hetzner / Ceph / … — production):** the | ||
| same, plus `storage.s3.endpoint`: | ||
|
|
||
| ```sh | ||
| helm install ourios deploy/helm/ourios \ | ||
| --set image.tag=<release> \ | ||
| --set storage.backend=s3 \ | ||
| --set storage.s3.bucket=my-ourios-bucket \ | ||
| --set storage.s3.endpoint=https://<provider-s3-endpoint> \ | ||
| --set storage.s3.region=auto \ | ||
| --set storage.s3.existingSecret=ourios-s3 | ||
| ``` | ||
|
|
||
| The chart **fails to render** an `s3` backend with no `storage.s3.bucket`, so a | ||
| broken store can never install. | ||
|
|
||
| **Local backend (the default — single-node / dev only):** | ||
|
|
||
| ```sh | ||
| helm install ourios deploy/helm/ourios # storage.backend=local | ||
| ``` | ||
|
|
||
| `local` provisions one shared `ReadWriteOnce` PVC mounted by all three | ||
| workloads. That is coherent **only on a single node** (the pods must | ||
| co-schedule) **or with a `ReadWriteMany` StorageClass** — on a typical | ||
| multi-node RWO cluster some workloads will stay `Pending`. It is intended for | ||
| kick-the-tires / dev; **use `s3` in production**, where the workloads share the | ||
| store over object storage and scale independently. | ||
|
|
||
| Verify: | ||
|
|
||
| ```sh | ||
| helm test ourios | ||
| ``` | ||
|
|
||
| > The image tag defaults to `latest` (no image is published for the | ||
| > pre-release `0.0.0` app version); pin a released tag via `image.tag` in | ||
| > production. | ||
|
|
||
| ## Credentials | ||
|
|
||
| Credentials are **never** chart config as plaintext. Static credentials use the | ||
| **S3-named** keys Ourios reads (`OURIOS_S3_*`, RFC 0019 §3.4) — not AWS-specific; | ||
| they work against AWS S3 and every S3-compatible provider (MinIO, R2, Hetzner, | ||
| Ceph, …). Supply exactly one of: | ||
|
jensholdgaard marked this conversation as resolved.
Resolved
|
||
|
|
||
| 1. **`storage.s3.existingSecret`** — the name of a `Secret` holding | ||
| `OURIOS_S3_ACCESS_KEY_ID` and `OURIOS_S3_SECRET_ACCESS_KEY` (and optionally | ||
| `OURIOS_S3_SESSION_TOKEN`). Injected via `envFrom`. Works for AWS S3 **and any | ||
| S3-compatible provider**. Create it yourself: | ||
|
|
||
| ```sh | ||
| kubectl create secret generic ourios-s3 \ | ||
| --from-literal=OURIOS_S3_ACCESS_KEY_ID=... \ | ||
| --from-literal=OURIOS_S3_SECRET_ACCESS_KEY=... | ||
| ``` | ||
|
|
||
| 2. **IRSA** (AWS EKS only) — leave `storage.s3.existingSecret` empty and set the | ||
| role ARN on the service account (this path uses the AWS credential chain): | ||
|
|
||
| ```sh | ||
| --set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"=arn:aws:iam::<acct>:role/<role> | ||
| ``` | ||
|
jensholdgaard marked this conversation as resolved.
Resolved
|
||
|
|
||
| The pod assumes the role; no static keys exist anywhere. This mode is | ||
| AWS-specific; on other providers use `storage.s3.existingSecret`. It requires | ||
| `serviceAccount.create=true` (the default) so the chart renders the | ||
| ServiceAccount and applies the annotation — the chart fails render if a | ||
| role-arn is set with `serviceAccount.create=false`. To use an existing SA, | ||
| annotate it out-of-band instead. | ||
|
|
||
| Setting **both** `storage.s3.existingSecret` and the IRSA `role-arn` annotation | ||
| **fails render** — the static keys would shadow the web-identity credentials, so | ||
| exactly one mode must be chosen. | ||
|
|
||
| For a **non-AWS provider**, also set `storage.s3.endpoint` to its S3 endpoint URL | ||
| (e.g. `http://minio:9000`, a Cloudflare R2 / Hetzner endpoint, …) and | ||
| `storage.s3.region` to the provider's region (or a placeholder like `us-east-1` | ||
| if it has none). | ||
|
|
||
| ## Compactor topology | ||
|
|
||
| The `ourios-server` binary runs the compaction role by default. To avoid every | ||
| pod sweeping, the receiver and querier workloads set `OURIOS_COMPACTION_ENABLED=0`, | ||
| so a **single dedicated `compactor` Deployment (1 replica)** is the only sweeper. | ||
|
|
||
| Scaling that compactor `Deployment` past 1 replica is **safe but unnecessary**: | ||
| the manifest publish-CAS commit (RFC 0009 §3.2 / RFC0013.3–.4) makes concurrent | ||
| sweeps correct — a losing sweeper's consolidated file is just an orphan a later | ||
| sweep reclaims — but it duplicates the per-interval object listing for no gain. | ||
| A `replicas: 1` Deployment self-heals (k8s reschedules a dead pod; a brief gap | ||
| in this background maintenance is harmless), so leader election isn't needed and | ||
| is intentionally out of scope. Tune the cadence via `compactor.intervalSecs`. | ||
|
|
||
| ## Key values | ||
|
|
||
| | Key | Default | Description | | ||
| | --- | --- | --- | | ||
| | `image.repository` | `ghcr.io/jensholdgaard/ourios` | Image repository. | | ||
| | `image.tag` | `""` (→ `latest`) | Image tag; pin a released tag in production. | | ||
| | `storage.backend` | `local` | `local` (single-node/dev) or `s3` (production — the S3 API, AWS or any S3-compatible provider). | | ||
| | `storage.s3.bucket` | `""` | **Required for s3** (`OURIOS_S3_BUCKET`); render fails if empty. | | ||
| | `storage.s3.endpoint` | `""` | S3-compatible endpoint URL — set for any non-AWS provider (MinIO/R2/Hetzner/Ceph/LocalStack); empty targets AWS. | | ||
| | `storage.s3.region` | `""` | Bucket region; drives both `OURIOS_S3_REGION` and `AWS_DEFAULT_REGION`. | | ||
| | `storage.s3.prefix` | `""` | Key prefix within the bucket. | | ||
| | `storage.s3.existingSecret` | `""` | Secret with the S3-named credential keys (`OURIOS_S3_ACCESS_KEY_ID`/`OURIOS_S3_SECRET_ACCESS_KEY`), injected via `envFrom`. Used by any S3-compatible provider. | | ||
| | `storage.local.bucketRoot` | `/var/lib/ourios/data` | Data dir for the local backend. | | ||
| | `storage.local.size` | `10Gi` | Local data PVC size. | | ||
| | `receiver.enabled` | `true` | OTLP ingest StatefulSet (gRPC `:4317` + HTTP `:4318`). | | ||
| | `receiver.replicas` | `1` | Receiver replicas (each gets its own WAL PVC). | | ||
| | `receiver.wal.size` | `2Gi` | WAL PVC size (`OURIOS_WAL_ROOT`, always local). | | ||
| | `receiver.wal.storageClassName` | `""` | WAL StorageClass (`""` = cluster default). | | ||
| | `querier.enabled` | `true` | Querier Deployment (HTTP `:4319`). | | ||
| | `querier.replicas` | `2` | Querier replicas (scales independently, no PVC). | | ||
| | `querier.defaultWindowSecs` | `3600` | Default look-back for a query with no `range(...)`. | | ||
| | `compactor.enabled` | `true` | Dedicated singleton compactor Deployment. Setting `false` **fails render** (the only sweeper — hazard #4). | | ||
| | `compactor.intervalSecs` | `300` | Compaction sweep cadence (used only by the dedicated compactor). | | ||
| | `serviceAccount.annotations` | `{}` | AWS EKS IRSA `eks.amazonaws.com/role-arn` goes here (alternative to `storage.s3.existingSecret`). | | ||
| | `otel.exporterEndpoint` | `""` | OTLP endpoint for Ourios's own self-telemetry. | | ||
| | `extraEnv` | `[]` | Extra env vars (e.g. `OTEL_*`). No plaintext creds. | | ||
|
|
||
| The image runs as nonroot (uid 65532) with a read-only root filesystem; the | ||
| chart sets `fsGroup` so the process can write the WAL PVC. | ||
|
|
||
| ## Probes | ||
|
|
||
| The binary exposes no HTTP health route yet (the OTLP and query endpoints are | ||
| POST-only), so the chart uses **TCP socket probes** on the bound role ports | ||
| (receiver `:4318`, querier `:4319`). The compactor has no listening port and | ||
| no probe; it is supervised by the process. Swap these for HTTP probes once a | ||
| `/healthz` endpoint lands. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #!/usr/bin/env python3 | ||
| """Render the Ourios Helm chart topology (RFC 0019, S3-compatible object storage). | ||
|
|
||
| Generates `topology.png` next to this file using the mingrammer `diagrams` | ||
| library (https://diagrams.mingrammer.com/) and its Kubernetes node set | ||
| (https://diagrams.mingrammer.com/docs/nodes/k8s). Requires Graphviz (`dot`) | ||
| and the `diagrams` package: | ||
|
|
||
| python3 -m venv .venv && . .venv/bin/activate | ||
| pip install diagrams # plus a system Graphviz install | ||
| python deploy/helm/ourios/docs/topology.py | ||
|
|
||
| This diagram lives with the chart (outside the `docs/` mdBook tree), so the | ||
| mdBook diagram conventions (`CLAUDE.md` §6.7: Mermaid for RFCs, SVG for | ||
| lectures) do not apply; the chart README embeds the rendered PNG. Keep this | ||
| script in sync with the chart when the topology changes. | ||
| """ | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| from diagrams import Cluster, Diagram, Edge | ||
|
|
||
| # Kubernetes node icons — https://diagrams.mingrammer.com/docs/nodes/k8s | ||
| from diagrams.k8s.compute import Deployment, Pod, StatefulSet | ||
| from diagrams.k8s.ecosystem import Helm | ||
| from diagrams.k8s.group import Namespace | ||
| from diagrams.k8s.network import Service | ||
| from diagrams.k8s.podconfig import Secret | ||
| from diagrams.k8s.rbac import ServiceAccount | ||
| from diagrams.k8s.storage import PVC, StorageClass | ||
|
|
||
| # The store is external object storage (the S3 icon is the recognizable | ||
| # object-store glyph; the backend is any S3-compatible provider, not AWS-only). | ||
| # Clients are off-cluster. | ||
| from diagrams.aws.storage import S3 | ||
| from diagrams.onprem.client import Client | ||
|
|
||
| OUTFILE = Path(__file__).with_suffix("") # .../topology -> diagrams appends .png | ||
|
|
||
| graph_attr = {"fontsize": "16", "labelloc": "t", "pad": "0.5", "splines": "spline"} | ||
|
|
||
| with Diagram( | ||
| "Ourios Helm chart — S3-compatible object-storage topology (RFC 0019)", | ||
| filename=str(OUTFILE), | ||
| show=False, | ||
| direction="TB", | ||
| outformat="png", | ||
| graph_attr=graph_attr, | ||
| ): | ||
| otlp = Client("OTLP exporters") | ||
| user = Client("query clients") | ||
| chart = Helm("ourios chart") | ||
|
|
||
| with Cluster("Kubernetes namespace"): | ||
| ns = Namespace("namespace") | ||
| sa = ServiceAccount("serviceAccount\n(IRSA role-arn, AWS EKS)") | ||
| secret = Secret("storage.s3.existingSecret\n(OURIOS_S3_* keys)") | ||
|
|
||
| with Cluster("receiver (StatefulSet)"): | ||
| rcv_svc = Service("receiver Service\ngRPC 4317 / HTTP 4318") | ||
| rcv = StatefulSet("ourios-server\nreceiver (compaction off)") | ||
| # Per-replica durable WAL — local PVC, NEVER S3 (§3.4 / §3.6). | ||
| wal_sc = StorageClass("local class") | ||
| wal = PVC("WAL PVC\n(per replica, local)") | ||
| rcv_svc >> rcv | ||
| rcv >> Edge(label="WAL-before-ack", style="bold") >> wal | ||
| wal_sc >> Edge(style="dotted") >> wal | ||
|
|
||
| with Cluster("querier (Deployment, N replicas)"): | ||
| qry_svc = Service("querier Service\nHTTP 4319") | ||
| qry = [ | ||
| Deployment("ourios-server\nquerier (compaction off)"), | ||
| Pod("…"), | ||
| ] | ||
| qry_svc >> qry[0] | ||
|
|
||
| with Cluster("compactor (Deployment, 1 replica)"): | ||
| cmp = Deployment("ourios-server\ncompactor\n(sole sweeper)") | ||
|
|
||
| s3 = S3("object store (S3 API)\ndata / audit / manifest") | ||
|
|
||
| # The chart renders the namespaced objects. | ||
| chart >> Edge(style="dotted", color="gray") >> ns | ||
|
|
||
| # Ingress edges. | ||
| otlp >> Edge(label="logs") >> rcv_svc | ||
| user >> Edge(label="logs DSL") >> qry_svc | ||
|
|
||
| # Data paths to the shared object store. The receiver and querier set | ||
| # OURIOS_COMPACTION_ENABLED=0, so ONLY the dedicated compactor sweeps | ||
| # (RFC 0009 §3.2) — no "also sweeps" edges from receiver/querier. | ||
| rcv >> Edge(label="write Parquet", color="darkgreen") >> s3 | ||
| qry[0] >> Edge(label="read", color="blue") >> s3 | ||
| cmp >> Edge(label="sweep / compact", color="firebrick") >> s3 | ||
|
|
||
| # Credentials are consumed by the workloads (the pods authenticate to the | ||
| # store), one of two mutually-exclusive ways: a mounted Secret of S3-named | ||
| # keys (envFrom) OR, on AWS EKS, IRSA on the ServiceAccount. The pods then use | ||
| # them on the existing workload→store paths above. | ||
| for workload in (rcv, qry[0], cmp): | ||
| secret >> Edge(style="dotted", label="envFrom") >> workload | ||
| sa >> Edge(style="dotted", label="IRSA (AWS EKS)") >> workload |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.