Repository navigation
Scaleway ADR - #150
Scaleway ADR#150thomasstart wants to merge 10 commits into
Conversation
AndreaGiardini
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Let's avoid Bitnami like the plague. Bitnami is not a company to be trusted with opensource anymore: bitnami/charts#35164
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
| - 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. |
There was a problem hiding this comment.
As long as the bast costs are this low, that's not very important
|
|
||
| ## Pros and Cons of the Options | ||
|
|
||
| ### Two Traefik deployments |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
This is now the chosen option
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Also the duckdb UI is readwrite and public. Arguably, it could be even more dangerous than dagster
There was a problem hiding this comment.
On another note, did we think about keeping dagster read-only everywhere and rely only on sensors and automations?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
What we do with a few different clients is:
main-> staging environmenttag-> prod environment
There was a problem hiding this comment.
i have used this in the adr
There was a problem hiding this comment.
I'd keep SRDP's own branch and tags out of this, since this describes the deployment environments. Each environment runs an SRDP release.
|
|
||
| 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`. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
also added to the ADR
yannick-vinkesteijn
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
@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.
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/scalewaywill 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.c4show these decisions, and each ADR links to its own view.Related issues
Related stories, and what ADR-0013, ADR-0014 and ADR-0015 settle:
Scaleway blueprint hardening #43 Scaleway blueprint hardening
scaleway_vpc_aclmoves to #87.Decide where Postgres runs on Kubernetes #65 Where Postgres runs
S3
StorageBackendfor object storage (ADR-0003 extra) #56 S3 storagenl-ams.Secrets out of Git #61 and Generate the platform secrets once and check them on every deploy #69 Secrets
Evaluate mesh and end-user access options #40 Secure access
End-to-end demo is available on scaleway #37 Scaleway demo
spike: plugin structure for deployment providers #86 Deployment plugins
Closes #
Changes
architecture/src/networking.c4andnetworking.views.c4srdp.devsubdomain.maindeploys to dev.docs/adr/index.mdand to the navigation inzensical.toml.Checklist
just test)just lint)just pre-commit)CHANGELOG.md's[Unreleased]section updated (if user-facing)