|
| 1 | +# PostgresCluster Helm Chart |
| 2 | + |
| 3 | +A Helm chart wrapper for deploying PostgreSQL clusters using [CrunchyData's PostgreSQL Operator (PGO)](https://access.crunchydata.com/documentation/postgres-operator/). |
| 4 | + |
| 5 | +## Purpose |
| 6 | + |
| 7 | +This chart creates `PostgresCluster` custom resources that are managed by PGO. It serves as a configuration layer between eoAPI and the PostgreSQL operator, providing: |
| 8 | + |
| 9 | +- **PostGIS support** for geospatial data |
| 10 | +- **PgBouncer** connection pooling |
| 11 | +- **Configurable backups** (S3, GCS, Azure, or volume-based) |
| 12 | +- **eoAPI-specific defaults** for schema permissions and database setup |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +Install the PostgreSQL Operator first: |
| 17 | + |
| 18 | +```bash |
| 19 | +helm install --set disable_check_for_upgrades=true pgo \ |
| 20 | + oci://registry.developers.crunchydata.com/crunchydata/pgo \ |
| 21 | + --version 5.7.4 |
| 22 | +``` |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +This chart is typically used as a dependency of the main eoAPI chart: |
| 27 | + |
| 28 | +```yaml |
| 29 | +# In eoAPI's Chart.yaml |
| 30 | +dependencies: |
| 31 | + - name: postgrescluster |
| 32 | + version: 5.7.4 |
| 33 | + repository: "https://devseed.com/eoapi-k8s/" |
| 34 | + condition: postgrescluster.enabled |
| 35 | +``` |
| 36 | +
|
| 37 | +### Standalone Installation |
| 38 | +
|
| 39 | +```bash |
| 40 | +helm install my-postgres ./charts/postgrescluster \ |
| 41 | + --set postgresVersion=16 \ |
| 42 | + --set postGISVersion=3.4 |
| 43 | +``` |
| 44 | + |
| 45 | +## Key Configuration |
| 46 | + |
| 47 | +| Parameter | Description | Default | |
| 48 | +|-----------|-------------|---------| |
| 49 | +| `postgresVersion` | PostgreSQL version | `16` | |
| 50 | +| `postGISVersion` | PostGIS version | `3.4` | |
| 51 | +| `pgBouncerReplicas` | Number of PgBouncer instances | `1` | |
| 52 | +| `backupsEnabled` | Enable pgBackRest backups | `false` | |
| 53 | +| `instances` | PostgreSQL instance configuration | See values.yaml | |
| 54 | + |
| 55 | +### Instance Configuration |
| 56 | + |
| 57 | +```yaml |
| 58 | +instances: |
| 59 | + - name: postgres |
| 60 | + replicas: 2 # High availability with 2 replicas |
| 61 | + dataVolumeClaimSpec: |
| 62 | + accessModes: ["ReadWriteOnce"] |
| 63 | + resources: |
| 64 | + requests: |
| 65 | + storage: 10Gi |
| 66 | +``` |
| 67 | +
|
| 68 | +### Backup Configuration |
| 69 | +
|
| 70 | +```yaml |
| 71 | +backupsEnabled: true |
| 72 | +s3: |
| 73 | + bucket: "my-backups" |
| 74 | + endpoint: "s3.amazonaws.com" |
| 75 | + region: "us-east-1" |
| 76 | + key: "ACCESS_KEY_ID" |
| 77 | + keySecret: "SECRET_ACCESS_KEY" |
| 78 | +``` |
0 commit comments