Skip to content

feat: add kubernetes deployment to docs - #121

Open
f-necas wants to merge 1 commit into
mainfrom
k8s-docs
Open

feat: add kubernetes deployment to docs#121
f-necas wants to merge 1 commit into
mainfrom
k8s-docs

Conversation

@f-necas

@f-necas f-necas commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

databases explanation and interactions schema

@f-necas
f-necas requested a review from pmauduit August 31, 2026 09:57
@f-necas f-necas changed the title feat: add kubernetes deployment to docs, databases explanation and feat: add kubernetes deployment to docs Aug 31, 2026

@pmauduit pmauduit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the doc, here are some feedback reviewing it.

Globally, I think that it is sometimes very verbose, and we could simplify some of the paragraphs to a more concise version of them, making it a bit "less painful" to read.

| Database | Holds | Written/read by |
|---|---|---|
| **geOrchestra DB** (`datafeeder` schema) | Datafeeder's own bookkeeping: `IntegrityLink` records, authorization rules, schedules | Backend (read/write), Airflow (read-only, to find datasets scheduled for a recurring re-run) |
| **Data DB** (`data` / `staging` schemas) | The actual dataset content: staging tables during ingestion, then the final published tables | Backend, Airflow DAGs, GeoServer (via JNDI, to serve the published layers) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it would be interesting for people to have an introduction of what airflow provides in the context of the DFv2, as even after the setup from last week, I still don't know what a DAG is exactly.

Comment on lines +18 to +22
- **The data DB** is isolated because it has a completely different profile: it can grow arbitrarily large (one
table per published dataset), and — unlike every other piece of geOrchestra state — **GeoServer reads from it
directly** (via JNDI), not through an API. Keeping it separate lets you size, back up, and scale it
independently of platform metadata, and means GeoServer only ever needs credentials scoped to dataset content,
never to the rest of the platform (users, orgs, LDAP-adjacent tables, etc.).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this paragraph is a bit verbose: just telling that it is meant to store the geodata and is expected to be accessible to GS via a JNDI resource is enough IMHO.

Comment on lines +23 to +28
- **The Airflow metadata DB** is owned end-to-end by Airflow itself: its schema is created and migrated by Airflow's
own release cycle, independent of Datafeeder/geOrchestra upgrades. It also churns heavily (a row per task
instance/log — see the `airflowDbCleanup` CronJob in the Helm chart, which periodically purges old rows) and
stores encrypted credentials (Airflow Connections, encrypted with the Fernet key). Keeping it separate avoids
coupling its lifecycle/retention policy to the rest of the platform, and limits the blast radius of those stored
credentials.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as the previous one, just saying that airflow manages it (and yes you could reuse an existing db previously mentioned) but it would lead you with a gazillion of tables, that will "pollute" a geOrchestra env.

Comment on lines +42 to +46
Alembic (the backend's migration tool) does **not** bootstrap the schema from scratch: its baseline migration is a
no-op, it only applies changes on top of an already-existing schema (see
[`001_baseline.py`](https://github.com/georchestra/datafeeder/blob/main/apps/backend/alembic/versions/001_baseline.py)).
The Docker Compose setup runs the init scripts below automatically before the backend starts; any other deployment
(Kubernetes included) must run them once, manually, against the target instance(s) before the first install:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is in the scope of this documentation to explain what alembin does and/or does not (yet TIL something about it). I'd have phrased it: "Alembic is being used for data migration, but an init-script is responsible for the initial bootstrap of the db".

Comment on lines +8 to +9
[Component interactions](../presentation.md#component-interactions) for a diagram of how the pieces below talk to
each other.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interact with each other ?

`<release>-database-data` secret for you. If you leave it unset, the backend pod will fail to start
(`CreateContainerConfigError`, missing secret `<release>-database-data`).

Either point `backend.data_db.existingSecret` at an existing secret (e.g. the same one as

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point to ?

|---|---|---|
| `AIRFLOW_CONN_DATA_PG` | **Yes** | The data database (staging/final tables) |
| `AIRFLOW_CONN_DATAFEEDER_PG` | **Yes** | The georchestra/`datafeeder` schema database |
| `AIRFLOW_CONN_SOURCE_DB_1` | Only if using the **Database** source type | See [adding a source database](../configuration/source_database.md) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I needed it for my deployment last week, I used the 3 following ones:

  • AIRFLOW__DATABASE__SQL_ALCHEMY_CONN (airflow)
  • AIRFLOW_CONN_DATA_PG (my "source" database ?)
  • AIRFLOW_CONN_DATAFEEDER_PG (the geOrchestra db)

I saw the DB_1 from the setup I took inspiration from, but was it actually useful ?

for the schemas/extensions/scripts that must be applied to each **before the first install** (Alembic's baseline
migration assumes the schema already exists — it doesn't bootstrap it).

### The chart doesn't create a secret for the "data" database

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it should ? :-)


![Datafeeder component interactions](../images/datafeeder-architecture.jpg)

!!! info "How the pieces talk to each other"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go for "interact with each other", but it is purely personal taste.

Comment thread Makefile
Comment on lines +53 to +59
docs-serve: ## Serve the documentation locally with live-reload (http://127.0.0.1:8000)
uv run --with-requirements mkdocs_requirements.txt mkdocs serve

docs-build: ## Build the static documentation site into ./site
uv run --with-requirements mkdocs_requirements.txt mkdocs build

.PHONY: default help install-python fix-and-check-all-python build-libs up up-no-airflow down down-v run-backend docs-serve docs-build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated but probably useful, I'd expect that docs-serve would block on having the server running though ?


| Target | Script | Creates |
|---|---|---|
| geOrchestra DB | [`docker/datafeeder-init.sql`](https://github.com/georchestra/datafeeder/blob/main/docker/datafeeder-init.sql) (same content as [`georchestra/migrations/26.0/db_migration_new_datafeeder.sql`](https://github.com/georchestra/georchestra/blob/master/migrations/26.0/db_migration_new_datafeeder.sql), for platforms upgrading from 25 to 26) | `datafeeder` schema, `pgcrypto` extension, `staging` schema/grants |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mentioned script in geor/geor creates the data & staging schemas which are only used in the "data" database. Outside of the scope of this PR probably, but should be removed there to avoid introducing more confusion.

@pmauduit

pmauduit commented Sep 1, 2026

Copy link
Copy Markdown
Member

Discussed this morning, it would be worth, either to add an extra object (NetworkPolicy) into the helm chart or explaining how to secure the feature which allows to fetch remote datasets (in order to avoid SSRF security issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants