Skip to content

Scaleway ADR - #150

Open
thomasstart wants to merge 10 commits into
mainfrom
docs/44-combine-scaleway-setups
Open

thomasstart wants to merge 10 commits into
mainfrom
docs/44-combine-scaleway-setups

Conversation

@thomasstart

@thomasstart thomasstart commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR provides design records for a SRDP scaleway setup. It relates to a lot of issues, so below an explanation per issue what is done.

Conclusion is to keep most of Andrea's setup with some extras and a few deviations. A comparision what is kept and what not is in #44 comments.
We keep the hub-and-spoke design from Andrea's blueprint, with one Scaleway Project per environment and private nodes that reach the internet through one Public Gateway.
The old stack in deploy/opentofu/scaleway will be dropped, because it never produced a working environment.
The extras are Postgres as a managed database outside the cluster, a private load balancer for the operator tools, and a Kubernetes API ACL that allows only the gateway IP and one break-glass /32.
The main deviation is that end users open the apps in a browser through a public load balancer behind the Zitadel login, so only operators need the Headscale mesh.
The hub and the spokes are also not peered, so all outbound traffic leaves through the gateway of each spoke and not through the hub.
The LikeC4 views in architecture/src/networking.views.c4 show these decisions, and each ADR links to its own view.

Related issues

Related stories, and what ADR-0013, ADR-0014 and ADR-0015 settle:

Changes

  • Add LikeC4 views for the Scaleway network in architecture/src/networking.c4 and networking.views.c4
  • Add ADR-0013 (network topology on Scaleway). It chooses hub and spokes, a Project per environment, private nodes behind one Public Gateway and a managed Postgres on the private network. It also lists the seven conditions before customer data, and the consequences of sensitive state buckets and a multi-node cluster.
  • Add ADR-0014 (ingress on Scaleway). It chooses one Traefik with a public and a private load balancer, a role per route, a login without loops and a DNS-01 wildcard certificate on a delegated srdp.dev subdomain.
  • Add ADR-0015 (operator access on Scaleway). It chooses a Headscale mesh for operators and an API ACL with the gateway IP and one break-glass and CI has no Scaleway credentials.
  • Add ADR-0016 (GitOps with Flux). Flux in each cluster pulls its leaf from Git and installs the chart as OCI with a pinned version per environment. A merge to main deploys to dev.
  • Add the four ADRs to docs/adr/index.md and to the navigation in zensical.toml.

Checklist

  • Tests pass (just test)
  • Linting passes (just lint)
  • pre-commit checks pass (just pre-commit)
  • Documentation updated (if applicable)
  • CHANGELOG.md's [Unreleased] section updated (if user-facing)
  • No secrets committed

@thomasstart thomasstart linked an issue Oct 30, 2026 that may be closed by this pull request
@thomasstart thomasstart changed the title likec4 networking Combine Scaleway Setups Oct 30, 2026
@thomasstart thomasstart changed the title Combine Scaleway Setups Scaleway Setup Oct 30, 2026
@thomasstart thomasstart changed the title Scaleway Setup Scaleway ADR Oct 30, 2026
@thomasstart
thomasstart marked this pull request as ready for review November 3, 2026 09:08

@AndreaGiardini AndreaGiardini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Added a few comments to the ADRs, let me know what you think but great work overall 👍


## Decision Outcome

Chosen option: "Hub and spokes", because a Project per environment gives a boundary that Scaleway enforces for networks, IAM and billing, and the hub keeps the shared parts in one place.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks god, hub and spokes is indeed industry standard, i support this decision

- The Container Registry holds the project images and the OCI chart, which Flux installs as [ADR-0016](./0016-gitops-with-flux.md) describes.
- Headscale runs on one small VM and coordinates the operator mesh, as [ADR-0015](./0015-operator-access-on-scaleway.md) describes.

The hub and the spokes are not peered.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would not be so strict. When i developed this, VPC peering wasn't a thing in Scelaway (it became GA in June 2026). I don't have any strong opinion whether it's required or not

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I've made it a choice for the first version. It can be turned on later with enable_hub_peering. Peering the hub would also weaken the isolation boundary, because a compromised hub could reach every spoke.

That state includes the users, the run history and the table metadata, and the platform cannot rebuild it from Git.
We considered two places for Postgres in a spoke.

1. The in-cluster Postgres from the Bitnami subchart, which kind uses today.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's avoid Bitnami like the plague. Bitnami is not a company to be trusted with opensource anymore: bitnami/charts#35164

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Option 1 now says "in-cluster Postgres" instead of naming Bitnami, and it links #123, which replaces the subchart with an SRDP template on the Compose image. The cloud never uses the in-cluster Postgres. The chart turns it off and points at the managed database.

The private connection, TLS and the roles are then proven in dev before stage and prod copy them.

The managed database costs about €12 to €15 per month with storage, and it keeps running when the node pools are at zero.
The in-cluster option costs nothing extra, but it would bring the failure of #65 to every environment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm all-in on the managed DB. we don't want to think about backups, restore, storage, etc. that's not the focus of SRDP. 12-15e/month is peanuts for the kind of security and service it provides

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes me too!

- Good, because dev is identical to stage, so every concept is proven before it reaches customer data.
- Good, because Postgres runs outside the cluster, so a node failure or a memory limit in the cluster cannot stop the platform state.
- Bad, because the Public Gateway is a single point of failure for all outbound traffic, for the API path and for the lakehouse data.
- Bad, because the gateway, the load balancers and the database keep running when the node pools are at zero, so switching dev off saves only about €20 to €40 per month.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As long as the bast costs are this low, that's not very important

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

agree

Comment thread docs/adr/0014-ingress-on-scaleway.md Outdated

## Pros and Cons of the Options

### Two Traefik deployments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would be more in favor of this solution so that we split public and private traffic. A vulnerability on the public traefik should not have no chance to get to the private network ( here we can use NetworkPolicies)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is now the chosen option

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A NetworkPolicy denies incoming traffic in the namespace by default and lets the public Traefik reach only the public backends. A flaw in the public Traefik then gives no path to the operator tools. The old single-Traefik option moved to Pros and Cons.

### Everything on the public load balancer behind the login

- Good, because it is the simplest setup and costs no extra load balancer.
- Bad, because the read-write Dagster is reachable from the internet, and only the login protects it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also the duckdb UI is readwrite and public. Arguably, it could be even more dangerous than dagster

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On another note, did we think about keeping dagster read-only everywhere and rely only on sensors and automations?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The DuckDB UI reads the files with the S3 reader key, but it connects to the catalog as the postgres superuser, so it can even attach the Zitadel database.
#132 fixes that with a reader role for the apps, and the ADR now links it.
The UI stays public only for the demo on sample data, and it moves to the private Traefik before customer data.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Interesting idea. It would remove the private Dagster entirely. The cost is that manual backfills and re-runs then go through kubectl or the CLI instead of the browser. I'd keep the private read-write Dagster for now, but I'm open to it. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, agreed the Dagster UI should be read-only, and operators can still open the read-write Dagster with kubectl port-forward. A second Traefik mixes an operator-specific setup into the core platform and sets it for every deployment. I'm not sure that's something we want to decide here, since it locks in the operator and deployment setup.


CI has no Scaleway credentials.
It only runs checks that need no cloud access, such as `tofu fmt`, `tofu validate` and the linters.
An operator runs every `tofu plan` and `tofu apply` from their own machine, with the API key of that environment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be much better to automate this using something like atlantis. As the project grows, running things locally becomes a pain a constant cause of conflicts

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense to take that direction, i wrote it into the ADR. Atlantis will run before stage / prod exist.
I need to look into scaleways oidc federation because i see nog docs for shortlived tokens for ci jobs.

Do you think vm in the hub running Atlantis would suffice?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Atlantis looks good. Atlantis would run on every PR in this repo and hold the Scaleway keys, so it belongs to deployment and not core platform. So we should first discuss platfomr/deployment split and where the infra code and its CI live.

### The chart and the images

- The chart is published as OCI to the hub registry under its chart version.
- Each leaf pins one chart version, so a chart change reaches dev first, and stage and prod only move when their own pin changes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What we do with a few different clients is:

  • main -> staging environment
  • tag -> prod environment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i have used this in the adr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd keep SRDP's own branch and tags out of this, since this describes the deployment environments. Each environment runs an SRDP release.

Comment thread docs/adr/0016-gitops-with-flux.md Outdated

Some chart values come from OpenTofu outputs, such as the database host and the bucket names.
For now, a table in the runbook says which output fills which value, and an operator copies the values into the leaf.
#38 proposed that OpenTofu writes the outputs into a ConfigMap that the HelmRelease reads through `valuesFrom`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rather than a configmap, we let opentofu create secrets in secretmanager (https://www.scaleway.com/en/secret-manager/), the secrets are then pulled in the cluster using ExternalSecrets.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

also added to the ADR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For secrets, we should align with #69 and #165. SRDP generates its own internal secrets, so OpenTofu and ESO should only fill the external ones. Both issues are still open, so if you'd prefer another way we can discuss it.

@yannick-vinkesteijn yannick-vinkesteijn added the reference-deployment Belongs to a reference deployment, moves to its own repo label Nov 15, 2026

@yannick-vinkesteijn yannick-vinkesteijn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work Thomas!

I added some comments on places where choices for our Scaleway setup end up in the platform itself, so every deployment would get them.
We can evaluate these after we've decided on the boundary between the agnostic core platform and the reference implementations.

Three rules keep Zitadel itself recoverable.

- At least two human admins exist, and both use MFA.
- The setup service works with a Zitadel machine user and assigns the admin role from config on every deploy. The next deploy then undoes a wrong role change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This adds new srdp-setup behaviour for every deployment. It helps recovery, but if you remove an admin in Zitadel, the next deploy gives the role back unless the config changes too. #60 also proposes one redirect URI on auth.<domain> instead of one per hostname (line 117). Since this is core platform, can we discuss these separately from this ADR?

Issue #65 showed the risk of the in-cluster option.
On a fresh install the subchart's default memory limit of 192 MiB stopped Postgres during startup, and Zitadel and both Dagster webservers failed with it.
A larger limit fixes that one failure, but the database still shares nodes, memory and node pool changes with the apps that it serves.
#65 concluded that Postgres must not run inside the application cluster.

@yannick-vinkesteijn yannick-vinkesteijn Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

#65 proposed this as a longer-term idea, but it was closed and replaced by #123. That keeps Postgres in the cluster and an external Postgres as an option. So I'd scope this to the Scaleway setup.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i have added two options, the srdp core will keep it in cluster, scaleway reference has a managed db. I think it should not be the default, but it makes life so much easier.

…ay in ADR-0013

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dkapitan dkapitan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@thomasstart excellent work. I can't follow all the details, but I fully support the overall direction of how we deploy on Scaleway and future CSP.

Ine practical note: likec4 diagrams are now split acrosss this repo and srdp-hub/architecture. I think we should reconcile this.

I propose to integrate the most relevant parts from the other repo into the docs in this main repo. The separate architecture document can be revamped as a position paper / architectural intent document which is more high level.

This branch has not been deployed

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

Labels

reference-deployment Belongs to a reference deployment, moves to its own repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine the two Scaleway setups

4 participants