Skip to content

Commit

Permalink
Convert postgres-pgdump-backup to truecharts (#55)
Browse files Browse the repository at this point in the history
* Convert postgres-pgdump-backup to truecharts
* Adjusted readme
* Add changelog

---------

Co-authored-by: Eugen Mayer <[email protected]>
  • Loading branch information
JanPretzel and EugenMayer authored Mar 22, 2024
1 parent c7ef969 commit 6838911
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 368 deletions.
1 change: 0 additions & 1 deletion charts/postgres-pgdump-backup/.helmignore

This file was deleted.

6 changes: 6 additions & 0 deletions charts/postgres-pgdump-backup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.7.0

**BREAKING CHANGES!!**
The chart has been migrated to TrueCharts, thus most of the values have been remapped.
Please see the readme on how to map the new values like PGHOST and so forth. Should be a simple mapping.

## 0.6.0

- Use PG 15 by default. You can and should still change it to your PG version via the tag
Expand Down
6 changes: 6 additions & 0 deletions charts/postgres-pgdump-backup/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://tccr.io/truecharts
version: 20.2.0
digest: sha256:359af2c9a305ffcffcac7ec54df12c2a7f6c1ac66c3c0daec7940e695ea132e8
generated: "2024-03-16T14:53:50.625589324+01:00"
20 changes: 13 additions & 7 deletions charts/postgres-pgdump-backup/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
apiVersion: v2
name: postgres-pgdump-backup
home: https://github.com/prodrigestivill/docker-postgres-backup-local
version: 0.6.0
description: Backup postgres databases using pg_dump, retention and schedules
version: 0.7.0
apiVersion: v2
appVersion: 15
keywords:
- postgres
- backup
- retention
- pg_dump
# @see https://github.com/prodrigestivill/docker-postgres-backup-local
description: Backup postgres databases using pg_dump, retention and schedules
type: application
sources:
- https://github.com/EugenMayer/helm-charts/chats/postgres-pgdump-backup
- https://github.com/prodrigestivill/docker-postgres-backup-local
home: https://github.com/EugenMayer/helm-charts/chats/postgres-pgdump-backup
dependencies:
- name: common
# https://artifacthub.io/packages/helm/truecharts-library-charts/common
version: 20.2.0
repository: oci://tccr.io/truecharts
condition: ""
alias: ""
tags: []
import-values: []
2 changes: 2 additions & 0 deletions charts/postgres-pgdump-backup/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
update:
helm dependency update
49 changes: 35 additions & 14 deletions charts/postgres-pgdump-backup/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[CHANGLOG](./CHANGELOG.md)

# WAT

Helm for the postgres 'pg_dump' based backup solution [postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local).
Expand All @@ -20,43 +22,62 @@ We do not re-publish the docker-image but use the original one published in [pos

```bash
helm repo add eugenmayer https://eugenmayer.github.io/helm-charts/
helm install eugenmayer/coredns-private-dns-fix
helm install eugenmayer/postgres-pgdump-backup
```

## Adjustments / Fixes

- to fix https://github.com/prodrigestivill/docker-postgres-backup-local/issues/76 we are current also exposing `PGUSER`, `PGPASSWORD`, `PGHOST`,`PGPORT`as additional env variables
- To fix https://github.com/prodrigestivill/docker-postgres-backup-local/issues/76 we are current also exposing `PGUSER`, `PGPASSWORD`, `PGHOST`,`PGPORT`as additional env variables

## Helm values

Hopefully most of them are self-explaining. You might have a look on `configmaps.yaml` to understand, what values
are mapped in which [environment variables of the actual image](https://github.com/prodrigestivill/docker-postgres-backup-local#environment-variables=)
Mandatory values to set

- `PGHOST`: hostname/ip of your pg
- `POSTGRES_DB`: comma seperated list of databases to backup, for example: `sko,mattermost,paperless`

If any values are unclear, open an issue or a PR explaining those. Happy to include docs here for anything needed.
For example
```yaml
image:
tag: "16-debian"

### Mandatory values
workload:
main:
podSpec:
containers:
main:
env:
POSTGRES_HOST: mypostgres.local
POSTGRES_DB: sko,mattermost,paperless
```
- `image.tag` - set this to your pg version, see [docker available tags](https://hub.docker.com/r/prodrigestivill/postgres-backup-local/tags)
- `postgres.host` - set this to your postgres host
- `postgres.auth.existingSecretName` - set this to the existing secret holding `POSTGRES_USER` and `POSTGRES_PASSWORD`. Alternatively set `postgres.auth.user` and `postgres.auth.password`
You will also need to deploy a secret called `postgres-backup-local` (you can rename it, see values.yaml) with the following values
- `POSTGRES_USER`
- `POSTGRES_PASSWORD`
- `PGUSER` (same values, optional)
- `PGPASSWORD` (same values, optional)

Hint: You should not just set the mandatory fields by go through the entire `values.yaml` and ensure everything is
as expected.
see [values.yaml](./values.yaml) for a full list, but you will need to set

## FAQ

- **How to enable ssl support?** Add this to your values.yaml
```yaml
env:
PGSSLMODE: "require"
workload:
main:
podSpec:
containers:
main:
env:
PGSSLMODE: "require"
```

## Developing

Test chart-rendering

```bash
helm template . -f values.yaml -f values-mandatory-test.yaml
helm template . -f values.yaml
```

## Credits
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions charts/postgres-pgdump-backup/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
54 changes: 0 additions & 54 deletions charts/postgres-pgdump-backup/templates/_helpers.tpl

This file was deleted.

1 change: 1 addition & 0 deletions charts/postgres-pgdump-backup/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}
33 changes: 0 additions & 33 deletions charts/postgres-pgdump-backup/templates/configmap.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions charts/postgres-pgdump-backup/templates/monitoring-svc.yml

This file was deleted.

18 changes: 0 additions & 18 deletions charts/postgres-pgdump-backup/templates/postgres-secret.yaml

This file was deleted.

93 changes: 0 additions & 93 deletions charts/postgres-pgdump-backup/templates/statefulset.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions charts/postgres-pgdump-backup/templates/storage-pvc.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions charts/postgres-pgdump-backup/values-mandatory.yaml

This file was deleted.

Loading

0 comments on commit 6838911

Please sign in to comment.