-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: externalize postgres #2
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 all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5d576c8
chore: gitignore agent files
cmdoret 863bb16
refactor(postgres): drop templates
cmdoret 0386d6c
chore(postgres): drop chart dep
cmdoret 00469b0
chore: update ignore files
cmdoret f0a8f29
fix(just): drop bitnami repo installation
cmdoret 8cd0706
chore(treefmt): drop sops exception
cmdoret 3387698
chore(helm): update dummy values for linting
cmdoret 24bd54f
refactor(openwebui): drop postgres toggle
cmdoret 0d4658a
refactor(postgres): secret templating
cmdoret bf5054e
feat(just): bootstrap recipe
cmdoret e9322db
chore(nix): psql in devshell
cmdoret 2c003b0
chore: update env ignore rules
cmdoret 570b038
doc(readme): link to postgres doc
cmdoret 0ece9f0
refactor(postgres): template db name and role in url
cmdoret 6c1919f
ci(helm): dedicated templating check
cmdoret 5a83ada
doc(postgres): update instructions
cmdoret 4df3c48
fix(just): update default db names
cmdoret 6a1a0b1
refactor(values): postgresql nested in services
cmdoret 9845ada
doc(readme): fix hyperlinks
cmdoret 24cc48a
fix(knative): nil guards for optional values
cmdoret 9b9408c
fix(pvc): nil guards for optional values
cmdoret e020bb9
refactor(openwebui): move oauth secret to Secret resource
cmdoret e9f43e6
fix(postgres): move ON_ERROR_STOP into the init script
cmdoret 233302d
chore: typos
cmdoret c173904
fix(postgres): init-db comment
cmdoret a306c2e
fix(postgres): require ssl on init script
cmdoret 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
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 |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| **/charts/*.tgz | ||
| config.toml | ||
| *.dec.* | ||
| .env | ||
| *.env | ||
| .devenv/ | ||
| .direnv/ | ||
| .output/ | ||
|
|
||
| # agentic setup | ||
| .agents/ | ||
| .claude/ | ||
| AGENTS.md | ||
| CLAUDE.md |
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
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,4 @@ | ||
| # Copy to .env and fill in. Values are paths to secret files kept outside the repository. | ||
| # Used by `just db-bootstrap`. | ||
| OPENWEBUI_PG_PASSWORD_FILE= | ||
| AUTHENTIK_PG_PASSWORD_FILE= |
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 |
|---|---|---|
| @@ -1,9 +1,6 @@ | ||
| dependencies: | ||
| - name: postgresql | ||
| repository: https://charts.bitnami.com/bitnami | ||
| version: 18.7.0 | ||
| - name: authentik | ||
| repository: https://goauthentik.github.io/helm | ||
| version: 2026.5.2 | ||
| digest: sha256:2f5bc89396b1bb7a388a1c12c221d8f4a194812e83e54bd1839fb9bdb53e1b1c | ||
| generated: "2026-06-04T09:20:49.97286315+02:00" | ||
| digest: sha256:7cf416b44f9132417c0006541e59049f9a44a28e36f003842cd334781523d8a5 | ||
| generated: "2026-08-04T00:00:00.000000000+02:00" |
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
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
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,56 @@ | ||
| # PostgreSQL | ||
|
|
||
| The chart connects to an external PostgreSQL server, which | ||
| must be reachable from the cluster and accept TLS: both OpenWebUI and Authentik connect with | ||
| `sslmode=require`. | ||
|
|
||
| ## Roles and databases | ||
|
|
||
| The databases and roles need to be created ahead of time. We provide a helper just recipe to do it. | ||
|
|
||
| To use it, run this before installing: | ||
|
|
||
| ```bash | ||
| just db-bootstrap <host> [<admin-user>] [<openwebui-db>] [<authentik-db>] | ||
| ``` | ||
|
|
||
| The recipe reads the two application passwords from the files named in `.env` (copy | ||
| `.tpl.env` and fill in the paths), and prompts for the admin password. It needs an account | ||
| allowed to `CREATE ROLE` and `CREATE DATABASE`; on a managed or central server you may have | ||
| to ask a DBA to run [bootstrap-db.sql](../tools/scripts/bootstrap-db.sql) instead. Either way | ||
| it is safe to re-run: existing roles and databases are left untouched. | ||
|
|
||
| > [!NOTE] | ||
| > | ||
| > The sql script sends the application passwords in `CREATE ROLE` statements, so connect over TLS. | ||
| > The recipe does this for you. When running manually, use : | ||
| > | ||
| > ```bash | ||
| > psql "postgresql://<admin>@<host>/postgres?sslmode=require" -f tools/scripts/bootstrap-db.sql | ||
| > ``` | ||
|
|
||
| ## Values | ||
|
|
||
| The postgres values must be specified for `authentik` and `openwebui`. They may use the same | ||
| server, but should have different roles and databases. | ||
|
|
||
| ## Sharing a server between releases | ||
|
|
||
| The names default to `vllm-openwebui` and `vllm-authentik`, if multiple | ||
| releases share one server. Scope them per release, and pass the same names to | ||
| `just db-bootstrap`: | ||
|
|
||
| ```yaml | ||
| openwebui: | ||
| postgres: | ||
| database: staging-openwebui | ||
| authentik: | ||
| authentik: | ||
| postgresql: | ||
| name: staging-authentik | ||
| user: staging-authentik | ||
| ``` | ||
|
|
||
| A collision does not fail loudly: the bootstrap skips roles that already exist, so a second | ||
| release either fails to authenticate or, if the password was copied across, quietly shares | ||
| the first release's database. Give each release its own names, or its own server. |
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
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
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
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
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,10 @@ | ||
| {{- if .Values.openwebui.enabled }} | ||
| {{- /* Kept out of the Deployment so the credential is not readable from the pod spec. */}} | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: "openwebui-oauth" | ||
| type: Opaque | ||
| stringData: | ||
| OAUTH_CLIENT_SECRET: {{ .Values.authentik.oauthApp.clientSecret | required ".Values.authentik.oauthApp.clientSecret is required" }} | ||
| {{- end }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.