Skip to content

Commit

Permalink
Merge pull request #40 from bbkz/postgres
Browse files Browse the repository at this point in the history
Postgres update docs / no version bump
  • Loading branch information
bbkz committed Nov 25, 2023
2 parents 542695a + ad5dbeb commit f5bed11
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ The following settings are declared in the groundhog2k Helm charts.

#### PostgreSQL

wger-app requires for the django database migrations the superuser privileges, so we grant the `postgres.userDatabase.name` `SUPERUSER` with a `postgres.extraScripts`.

| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| `postgres.enabled` | Enable the PostgreSQL chart | Boolean | `True` |
Expand All @@ -201,6 +203,7 @@ The following settings are declared in the groundhog2k Helm charts.
| `postgres.userDatabase.name` | Database name to use for wger | String | `wger` |
| `postgres.userDatabase.user` | Username to use for wger | String | `wger` |
| `postgres.userDatabase.password` | Password for wger user | String | `wger` |
| `postgres.extraScripts` | A configmap used to grant privileges | String | `wger-pg-init` |
| `postgres.service.port` | PostreSQL service port | Integer | `5432` |
| `postgres.storage.persistentVolumeClaimName` | PVC name when existing storage volume should be used | String | `Nil` |
| `postgres.storage.requestedSize` | Size for new PVC, when no existing PVC is used | Integer | `8Gi` |
Expand Down
4 changes: 2 additions & 2 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The superuser was named `wger`, but this seems to lead to a error in the postgre
FATAL: role "postgres" does not exist
```

So you need to manually add a `postgres` superuser:
So if you are upgrading, you need to manually add a `postgres` superuser:

```bash
kubectl -n wger exec -ti wger-postgres-0 -- bash
Expand All @@ -21,7 +21,7 @@ psql -U wger
CREATE ROLE postgres WITH LOGIN SUPERUSER PASSWORD 'postgres';
```

As well set the settings in your `values.yaml`:
As well set the following settings in your `values.yaml`:

```yaml
postgres:
Expand Down
2 changes: 1 addition & 1 deletion charts/wger/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ apiVersion: v1
metadata:
name: wger-pg-init
data:
grantSuperuser.sql: |
40-grantSuperuser.sql: |
ALTER USER {{ .Values.postgres.userDatabase.name }} WITH SUPERUSER;
7 changes: 5 additions & 2 deletions charts/wger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,18 @@ postgres:
# Note: keep these variables present as the wger chart uses them for the deployment
# the superuser and user settings will be saved into a secret
enabled: true
# after the first installation the superuser and userDatabase settings will be ignored
# they will be taken from the secret
# changes to the superuser and userDatabase passwords will update
# the secret where they are save in
settings:
superuser: postgres
superuserPassword: postgres
userDatabase:
name: wger
user: wger
password: wger
# the user from the user database will be turned into a superuser
# some database migration in django requires this
# otherwise it was not able to create the database
extraScripts: wger-pg-init
service:
port: 5432
Expand Down

0 comments on commit f5bed11

Please sign in to comment.