Skip to content

Commit

Permalink
Create PostgreSQL Secret even if postgresql.enabled=false
Browse files Browse the repository at this point in the history
Ensures that the PostgreSQL Secret is created, even if
`postgresql.enabled=false`. This ensures that we support a use case
where folks want to use an external instance of PostgreSQL, but still
want the Secret to automatically be generated with the proper connection
string.

With a recent change, we would skip creation of this secret if
PostgreSQL was disabled which forced users to create a Secret
themselves. This change now allows them to continue providing the `auth`
values and letting the chart build the Secret with the correct
connection string.

Closes #358
  • Loading branch information
mitchnielsen committed Jul 23, 2024
1 parent 2ceeee9 commit ea9378c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion charts/prefect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ prefect-server:
postgresql:
# Disable the objects from the bundled PostgreSQL chart
enabled: false

auth:
# Provide the name of an existing secret following the instructions above.
# Option 1: provide the name of an existing secret following the instructions above.
existingSecret: <existing secret name>

# Option 2: provide the connection string details directly
username: myuser
password: mypass
database: mydb
```
Two secrets are created when not providing an existing secret name:
Expand Down
8 changes: 7 additions & 1 deletion charts/prefect-server/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ prefect-server:
postgresql:
# Disable the objects from the bundled PostgreSQL chart
enabled: false

auth:
# Provide the name of an existing secret following the instructions above.
# Option 1: provide the name of an existing secret following the instructions above.
existingSecret: <existing secret name>

# Option 2: provide the connection string details directly
username: myuser
password: mypass
database: mydb
```

Two secrets are created when not providing an existing secret name:
Expand Down
2 changes: 1 addition & 1 deletion charts/prefect-server/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.postgresql.enabled (not .Values.postgresql.auth.existingSecret) }}
{{- if not .Values.postgresql.auth.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand Down

0 comments on commit ea9378c

Please sign in to comment.