Skip to content

Commit 0d99e05

Browse files
author
Jon Sisson
committed
Update operator image for pooler removal fix and create gcs pgbackrest example.
1 parent b624039 commit 0d99e05

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# pgbackrest with GCS
2+
3+
## Creating the key.json file
4+
5+
The key.json file should be created on an appropriate GCP IAM service account with at least the minimum permissions for
6+
GCS to read/write to your bucket. Once the keyfile is downloaded, it should be created as a secret within kubernetes using
7+
either the appropriate ci/cd pipelines (leveraging an engine like Vault), or via:
8+
9+
```
10+
kubectl create secret generic gcs-credentials --from-file=/path/to/key.json
11+
```
12+
13+
## Method 1: operator configuration
14+
15+
The operator needs the following configuration enabled to mount the gcs-credentials secret in all postgres containers:
16+
17+
```
18+
configuration:
19+
aws_or_gcp:
20+
additional_secret_mount: gcs-credentials
21+
additional_secret_mount_path: /var/secrets/google
22+
gcp_credentials: /var/secrets/google/key.json
23+
```
24+
25+
## Method 2: per-cluster configuration
26+
27+
Alternatively you could utilize additionalVolumes in postgres.yaml to mount cluster-specific secrets in the postgresql cluster,
28+
but if you change the name or the path that the keyfile is mounted to, you need to update spec.backup.pgbackrest.global.repo1-gcs-key
29+
in postgres.yaml to match.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: cpo.opensource.cybertec.at/v1
2+
kind: postgresql
3+
metadata:
4+
name: cluster-1
5+
spec:
6+
dockerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1'
7+
numberOfInstances: 1
8+
postgresql:
9+
version: '16'
10+
resources:
11+
limits:
12+
cpu: 500m
13+
memory: 500Mi
14+
requests:
15+
cpu: 500m
16+
memory: 500Mi
17+
teamId: acid
18+
volume:
19+
size: 5Gi
20+
backup:
21+
pgbackrest:
22+
global:
23+
repo1-gcs-key: /var/secrets/google/key.json
24+
repo1-gcs-key-type: service
25+
repo1-path: /YOUR_PATH_INSIDE_THE_BUCKET/repo1/
26+
repo1-retention-full: '7'
27+
repo1-retention-full-type: count
28+
image: docker.io/cybertecpostgresql/cybertec-pg-container:pgbackrest-16.3-1
29+
repos:
30+
- endpoint: YOUR_GCS_ENDPOINT
31+
name: repo1
32+
resource: YOUR_BUCKET_NAME
33+
schedule:
34+
full: 30 2 * * *
35+
storage: gcs

setup/helm/operator/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ imagePullSecretNames: []
1515

1616
# Define the operator settings to add to the configmap
1717
operatorSettings:
18-
operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator:v0.7.0-1'
18+
operatorImage: 'docker.io/cybertecpostgresql/cybertec-pg-operator-dev:v0.7.0-2'
1919
postgresImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.3-1'
2020
poolerImage: 'docker.io/cybertecpostgresql/cybertec-pg-container:pgbouncer-1.22-1'
2121
watched_namespace: '*'

0 commit comments

Comments
 (0)