Skip to content

Commit

Permalink
Update README for new external db configuration
Browse files Browse the repository at this point in the history
Updates the README to reflect the new configuration for external
databases.
  • Loading branch information
mitchnielsen committed Jul 25, 2024
1 parent ae7f268 commit 93ed554
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 36 deletions.
45 changes: 27 additions & 18 deletions charts/prefect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ Note: If you choose to make modifications to either the `server.prefectApiUrl` o

### Handling Connection Secrets

If you are installing the chart as-is (and therefore installing PostgreSQL) - you'll need to update one of two fields:
1. `postgresql.auth.password`: a password you want to set for the prefect user
#### Using the bundled PostgreSQL chart

By default, Bitnami's PostgreSQL Helm Chart will be deployed. This is **not intended for production use**, and is only
included to provide a functional proof of concept installation.

In this scenario, you'll need to provide _either one_ of the following fields:

1. `postgresql.auth.password`: a password you want to set for the prefect user (default: `prefect-rocks`)

2. `postgresql.auth.existingSecret`: name of an existing secret in your cluster with the following field:

Expand All @@ -38,31 +44,34 @@ If you are installing the chart as-is (and therefore installing PostgreSQL) - yo
- hostname = `<release-name>-postgresql.<release-namespace>:<postgresql.containerPorts.postgresql>`
- database = `postgresql.auth.database`

Two secrets are created when not providing an existing secret name:
1. `prefect-server-postgresql-connection`: used by the prefect-server deployment to connect to the postgresql database.

2. `<release-name>-postgresql-0`: defines the `postgresql.auth.username`'s password on the postgresql server to allow successful authentication from the prefect server.

#### Using an external instance of PostgreSQL

If you want to disable the bundled PostgreSQL chart and use an external instance, provide the following configuration:

```yaml
prefect-server:
postgresql:
# Disable the objects from the bundled PostgreSQL chart
enabled: false

auth:
# 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
secret:
# Option 1: provide the name of an existing secret following the instructions above.
create: false
name: <existing secret name>

# Option 2: provide the connection string details directly
create: true
username: myuser
password: mypass
host: myhost.com
port: 1234
database: mydb
```
Two secrets are created when not providing an existing secret name:
1. `prefect-server-postgresql-connection`: used by the prefect-server deployment to connect to the postgresql database.

2. `<release-name>-postgresql-0`: defines the `postgresql.auth.username`'s password on the postgresql server to allow successful authentication from the prefect server.

No secrets are created when providing an existing secret.

### Connecting with SSL configured
1. Mount the relevant certificate to `/home/prefect/.postgresql` so that it can be found by `asyncpg`. This is the default location postgresql expects per their [documentation](https://www.postgresql.org/docs/current/libpq-ssl.html).
Expand Down
45 changes: 27 additions & 18 deletions charts/prefect-server/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ Note: If you choose to make modifications to either the `server.prefectApiUrl` o

### Handling Connection Secrets

If you are installing the chart as-is (and therefore installing PostgreSQL) - you'll need to update one of two fields:
1. `postgresql.auth.password`: a password you want to set for the prefect user
#### Using the bundled PostgreSQL chart

By default, Bitnami's PostgreSQL Helm Chart will be deployed. This is **not intended for production use**, and is only
included to provide a functional proof of concept installation.

In this scenario, you'll need to provide _either one_ of the following fields:

1. `postgresql.auth.password`: a password you want to set for the prefect user (default: `prefect-rocks`)

2. `postgresql.auth.existingSecret`: name of an existing secret in your cluster with the following field:

Expand All @@ -37,31 +43,34 @@ If you are installing the chart as-is (and therefore installing PostgreSQL) - yo
- hostname = `<release-name>-postgresql.<release-namespace>:<postgresql.containerPorts.postgresql>`
- database = `postgresql.auth.database`

Two secrets are created when not providing an existing secret name:
1. `prefect-server-postgresql-connection`: used by the prefect-server deployment to connect to the postgresql database.

2. `<release-name>-postgresql-0`: defines the `postgresql.auth.username`'s password on the postgresql server to allow successful authentication from the prefect server.

#### Using an external instance of PostgreSQL

If you want to disable the bundled PostgreSQL chart and use an external instance, provide the following configuration:

```yaml
prefect-server:
postgresql:
# Disable the objects from the bundled PostgreSQL chart
enabled: false

auth:
# 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
secret:
# Option 1: provide the name of an existing secret following the instructions above.
create: false
name: <existing secret name>

# Option 2: provide the connection string details directly
create: true
username: myuser
password: mypass
host: myhost.com
port: 1234
database: mydb
```

Two secrets are created when not providing an existing secret name:
1. `prefect-server-postgresql-connection`: used by the prefect-server deployment to connect to the postgresql database.

2. `<release-name>-postgresql-0`: defines the `postgresql.auth.username`'s password on the postgresql server to allow successful authentication from the prefect server.

No secrets are created when providing an existing secret.

### Connecting with SSL configured

1. Mount the relevant certificate to `/home/prefect/.postgresql` so that it can be found by `asyncpg`. This is the default location postgresql expects per their [documentation](https://www.postgresql.org/docs/current/libpq-ssl.html).
Expand Down

0 comments on commit 93ed554

Please sign in to comment.