Skip to content

Commit

Permalink
fix(cnpg): no default targetTime (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon authored Sep 19, 2023
1 parent dd263c0 commit 21d8e98
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,39 @@ cluster with enabled backup and recovery:
name: RELEASE-NAME-cnpg-cluster
immediate: true
schedule: 1 2 3 * * 0
cluster with latest recovery enabled:
1: |
bootstrap:
recovery:
source: recovery-cluster
externalClusters:
- barmanObjectStore:
destinationPath: s3://backups/
endpointURL: http://minio:9000
s3Credentials:
accessKeyId:
key: ACCESS_KEY_ID
name: minio
region:
key: ACCESS_REGION
name: minio
secretAccessKey:
key: ACCESS_SECRET_KEY
name: minio
serverName: my-cluster-to-restore
name: recovery-cluster
imageName: ghcr.io/cloudnative-pg/postgis:15
imagePullPolicy: IfNotPresent
instances: 1
maxSyncReplicas: 0
minSyncReplicas: 0
monitoring:
enablePodMonitor: false
postgresql:
parameters: null
pg_hba: null
storage:
size: 8Gi
cluster with monitoring:
1: |
apiVersion: postgresql.cnpg.io/v1
Expand All @@ -133,7 +166,7 @@ cluster with monitoring:
app.kubernetes.io/name: cnpg-cluster
app.kubernetes.io/version: "15"
cnpg.io/poolerName: RELEASE-NAME-cnpg-cluster-rw
helm.sh/chart: cnpg-cluster-1.12.3
helm.sh/chart: cnpg-cluster-1.12.4
name: RELEASE-NAME-cnpg-cluster-rw
spec:
cluster:
Expand Down
7 changes: 7 additions & 0 deletions charts/cnpg-cluster/tests/cnpg-cluster_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ tests:
- template: cluster.cnpg.yaml
matchSnapshot:
path: spec
- it: cluster with latest recovery enabled
values:
- ./values/recovery2.yaml
asserts:
- template: cluster.cnpg.yaml
matchSnapshot:
path: spec
- it: cluster with enabled backup and recovery
values:
- ./values/recovery.yaml
Expand Down
17 changes: 17 additions & 0 deletions charts/cnpg-cluster/tests/values/recovery2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
recovery:
enabled: true
barmanObjectStore:
destinationPath: s3://backups/
endpointURL: http://minio:9000
serverName: my-cluster-to-restore
s3Credentials:
accessKeyId:
name: minio
key: ACCESS_KEY_ID
secretAccessKey:
name: minio
key: ACCESS_SECRET_KEY
region:
name: minio
key: ACCESS_REGION
retentionPolicy: "30d"
2 changes: 1 addition & 1 deletion charts/cnpg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ recovery:

# Relative to Postgres server timezone
# @param {string} [targetTime] Time to restore from, in RFC3339 format https://datatracker.ietf.org/doc/html/rfc3339
targetTime: "2020-11-26T15:22:00"
targetTime: ""

# See: https://cloudnative-pg.io/documentation/current/backup_recovery/
# @param {object,null} [barmanObjectStore] Object store credentials and access config
Expand Down

0 comments on commit 21d8e98

Please sign in to comment.