Skip to content

Commit 344fed1

Browse files
committed
refactor(postgres): hardcode secret key password
1 parent 5c705c1 commit 344fed1

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎docs/postgresql.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ server, but should have different roles and databases.
3636
3737
## Passwords
3838
39-
The openwebui postgres password is read from Kubernetes `Secret` resources.
40-
Simply specify the resource name:
39+
The openwebui postgres password is read from a Kubernetes `Secret`, under the key `password`.
40+
The chart does not create it. Simply specify the resource name:
4141
4242
```yaml
4343
openwebui:

‎templates/authentik_validate.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- /* Renders nothing. Guards a subchart value the parent has no template of its own for. */}}
2+
{{- if .Values.authentik.enabled }}
3+
{{- /* The subchart defaults this to "<release>-postgresql", which will not resolve. */}}
4+
{{- $_ := .Values.authentik.authentik.postgresql.host | required ".Values.authentik.authentik.postgresql.host is required: the chart does not deploy PostgreSQL" }}
5+
{{- end }}

‎templates/openwebui/deployment.yaml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ spec:
3535
- name: OPENAI_API_BASE_URL
3636
value: https://gateway.{{ .Values.envoy.baseDomain }}/v1
3737
{{- $pg := .Values.openwebui.postgres }}
38-
{{- $ps := $pg.passwordSecret }}
3938
{{- /* Must precede DATABASE_URL: $(VAR) only expands earlier entries. */}}
4039
- name: PG_PASSWORD
4140
valueFrom:
4241
secretKeyRef:
43-
name: {{ $ps.name | required ".Values.openwebui.postgres.passwordSecret.name is required" }}
44-
key: {{ $ps.key }}
45-
{{- $db := $pg.database | required ".Values.openwebui.postgres.database is required" }}
42+
name: {{ $pg.passwordSecret.name | required ".Values.openwebui.postgres.passwordSecret.name is required" }}
43+
key: password
44+
{{- $db := $pg.database }}
4645
{{- /* One value fills both db and role. */}}
4746
- name: DATABASE_URL
4847
value: "postgresql://{{ $db }}:$(PG_PASSWORD)@{{ $pg.host | required ".Values.openwebui.postgres.host is required" }}:5432/{{ $db }}?sslmode=require"

‎values.yaml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ openwebui:
6060
host:
6161
# Database name, and the name of the role that owns it.
6262
database: vllm-openwebui
63-
# Existing secret holding the role's password.
63+
# Existing secret holding the role's password under the key "password".
6464
passwordSecret:
6565
name:
66-
key: password
6766
admin:
6867
user: admin
6968
email: admin@sdsc.ethz.ch

0 commit comments

Comments
 (0)