Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ 7 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
tanberry
reviewed
Mar 23, 2026
tanberry
reviewed
Mar 23, 2026
dominic-r
reviewed
Mar 23, 2026
Member
dominic-r
left a comment
There was a problem hiding this comment.
can we also update https://next.goauthentik.io/core/architecture/ ?
Member
Author
it's technically still correct |
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This reverts commit ffab30d.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
This PR makes a Rust binary the main entrypoint for running authentik. Here's what's changed:
ak workernow runs Rust. The worker processes aren't spawned from Python anymore, but directly from Rust. That means that each of them have to load Django, making their startup slower, but in turn we save on RAM usage since we don't have a top-level process that uses a huge amount of memory doing nothing.ak apply_blueprintisn't run from thelifecycle/akscript anymore, but by the first worker on startup. This allows for a faster startup since we don't need to load Django an extra time. It also fixes the issue of it failing if migrations hadn't run yet.ak serveralso starts Rust, which in turns starts Go, which in turns starts Python. See below for a detailed breakdown of who is listening where for whatlifecycle/ak) anymore, but from Rust, since we use that mode throughout the code to change various behavioursallinone, for when the worker and server run at the same time. This is aimed at dev setups only, and will not be advertised for now.ak healthcheckis now written in Rust/-/metrics/anymore, speeding up that request and freeing a slot for another one../manage.py dev_serveranymore, but by watchexec. This allows for a unified setup between Python, Rust and GoWhat's new
A bunch of Rust code, which in some places is incomplete:
src/axum/trace.rs: this is missing a few fields when logging requests. Fortunately, we only log metrics (in all cases) and healthcheck requests (for the worker). These extra fields will be added in follow-up PRs, mainly to reduce the size of this one, but they're written already in The Coup™ #18122src/axum/server.rs: we're missing a bunch of ways to accept requests, such as the proxy protocol. These will be added in later PRs for the same reasons as previously mentionedOther details
This adds 14MB to the final docker image
Listeners depending on the mode (
/tmpis used as a shorthand for$TMPDIR):server/tmp/authentik-core.sock/tmp/authentik.sockfor HTTP requests,listen.http,listen.https,/tmp/authentik-server-metrics.socklisten.metrics,/tmp/authentik-metrics.sockfor metrics requestsIn this mode, only metrics go through the rust process. It goes like this:
monitoring_setsignal should be sentprometheus_clientitselfHealthchecks are handled as before, by gunicorn
worker/tmp/authentik-worker.sockfor healthchecks and metricslisten.httpfor healthchecks,listen.metricsand/tmp/authentik-metrics.sockfor metricsIn this mode, everything goes through rust:
monitoring_setshould be sentprometheus_clientitselfallinoneThis is a mix and match of the above:
/tmp/authentik-core.sock/tmp/authentik.sockfor HTTP requests,listen.http,listen.https,/tmp/authentik-server-metrics.sock/tmp/authentik-worker.sockfor healthchecks and metricslisten.metrics,/tmp/authentik-metrics.sockfor metrics requestsFor metrics, the setup is the same as the server, as sending monitoring_set only on to gunicorn is sufficient.
For healthchecks, the setup is the same as the server, and we don't check the workers health at any point. This is fine since this is a development mode only. Once the server is written in Rust as well, we can improve this.
Closes #18292