Skip to content

Commit fb57eb8

Browse files
authored
Merge pull request #35 from small-hack/only-provide-backup-section-if-specified
only provide backup section if user specifies one, so that restores still work
2 parents e6f0b9f + 6614d6f commit fb57eb8

File tree

4 files changed

+32
-44
lines changed

4 files changed

+32
-44
lines changed

charts/cloudnative-pg-cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: cnpg-cluster
33
description: Create postgres tenant clusters managed by the CNPG Operator
44
type: application
5-
version: 0.3.14
5+
version: 0.3.15
66

77
maintainers:
88
- name: "cloudymax"

charts/cloudnative-pg-cluster/README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ Create postgres tenant clusters managed by the CNPG Operator
1515

1616
| Key | Type | Default | Description |
1717
|-----|------|---------|-------------|
18-
| backup.barmanObjectStore.destinationPath | string | `"s3://backups"` | |
19-
| backup.barmanObjectStore.endpointURL | string | `"http://HOST:PORT"` | |
20-
| backup.barmanObjectStore.s3Credentials.accessKeyId.key | string | `"ACCESS_KEY_ID"` | key in Kubernetes Secret to use for S3 access key ID |
21-
| backup.barmanObjectStore.s3Credentials.accessKeyId.name | string | `"aws-creds"` | existing Kubernetes Secret to use for S3 access key ID |
22-
| backup.barmanObjectStore.s3Credentials.secretAccessKey.key | string | `"ACCESS_SECRET_KEY"` | key in Kubernetes Secret to use for S3 secret key |
23-
| backup.barmanObjectStore.s3Credentials.secretAccessKey.name | string | `"aws-creds"` | existing Kubernetes Secret to use for S3 secret key |
24-
| backup.retentionPolicy | string | `"30d"` | how long to keep backups for |
18+
| backup | object | `{}` | if we should backup up this cluster, please see values.yaml for example |
2519
| bootstrap.initdb.database | string | `"app"` | initial database to create |
2620
| bootstrap.initdb.owner | string | `"app"` | owner of the initial database that is created above |
2721
| certificates.client.clientCASecret | string | `""` | name of existing Kubernetes Secret for the postgresql client Certificate Authority cert, ignored if certificates.generate is true |
@@ -43,12 +37,8 @@ Create postgres tenant clusters managed by the CNPG Operator
4337
| name | string | `"cnpg"` | |
4438
| postgresql.pg_hba | list | `["hostnossl all all 0.0.0.0/0 reject","hostssl all all 0.0.0.0/0 cert clientcert=verify-full"]` | records for the pg_hba.conf file. ref: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html |
4539
| primaryUpdateStrategy | string | `"unsupervised"` | |
46-
| resources.limits | object | `{"cpu":"1000m","memory":"512Mi"}` | resource limit for pods |
47-
| resources.requests | object | `{"cpu":"50m","memory":"64Mi"}` | minimum resources guaranteed for pods |
48-
| scheduledBackup.name | string | `"example-backup"` | name to use for your scheduled backup job |
49-
| scheduledBackup.spec.backupOwnerReference | string | `"self"` | |
50-
| scheduledBackup.spec.cluster.name | string | `"pg-backup"` | |
51-
| scheduledBackup.spec.schedule | string | `"0 0 0 * * *"` | crontab style schedule to run the backups |
40+
| resources | object | `{}` | |
41+
| scheduledBackup | object | `{}` | schduled backups section, please see values.yaml for example |
5242
| storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster |
5343
| superuserSecret | string | `""` | name of existing secret to use as superuser redentials will be randomly generated if not specified. |
5444
| testApp.enabled | bool | `false` | |

charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ spec:
99
enableSuperuserAccess: {{ .Values.enableSuperuserAccess }}
1010
superuserSecret: {{ .Values.superuserSecret }}
1111
primaryUpdateStrategy: {{ .Values.primaryUpdateStrategy }}
12-
{{- if .Values.backup }}
1312
{{- with .Values.backup }}
1413
backup:
1514
{{- toYaml . | nindent 4 }}
1615
{{- end }}
17-
{{- end }}
1816
{{- if .Values.externalClusters }}
1917
externalClusters:
2018
{{- range $reg, $props := .Values.externalClusters }}
@@ -42,7 +40,7 @@ spec:
4240
{{- end }}
4341
{{- end }}
4442
{{- if .Values.bootstrap.recovery }}
45-
{{- with .Values.bootstrap.recovery }}
43+
{{- with .Values.bootstrap.recovery }}
4644
recovery:
4745
{{- toYaml . | nindent 6 }}
4846
{{- end }}

charts/cloudnative-pg-cluster/values.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -69,33 +69,33 @@ externalClusters: []
6969
# wal:
7070
# maxParallel: 8
7171

72-
backup:
73-
# -- how long to keep backups for
74-
retentionPolicy: "30d"
75-
barmanObjectStore:
76-
destinationPath: "s3://backups"
77-
endpointURL: "http://HOST:PORT"
78-
s3Credentials:
79-
accessKeyId:
80-
# -- existing Kubernetes Secret to use for S3 access key ID
81-
name: "aws-creds"
82-
# -- key in Kubernetes Secret to use for S3 access key ID
83-
key: "ACCESS_KEY_ID"
84-
secretAccessKey:
85-
# -- existing Kubernetes Secret to use for S3 secret key
86-
name: "aws-creds"
87-
# -- key in Kubernetes Secret to use for S3 secret key
88-
key: "ACCESS_SECRET_KEY"
89-
90-
scheduledBackup:
91-
# -- name to use for your scheduled backup job
92-
name: example-backup
93-
spec:
94-
# -- crontab style schedule to run the backups
95-
schedule: "0 0 0 * * *"
96-
backupOwnerReference: self
97-
cluster:
98-
name: pg-backup
72+
# -- if we should backup up this cluster, please see values.yaml for example
73+
backup: {}
74+
# retentionPolicy: "30d"
75+
# barmanObjectStore:
76+
# destinationPath: "s3://backups"
77+
# endpointURL: "http://HOST:PORT"
78+
# s3Credentials:
79+
# accessKeyId:
80+
# # -- existing Kubernetes Secret to use for S3 access key ID
81+
# name: "aws-creds"
82+
# # -- key in Kubernetes Secret to use for S3 access key ID
83+
# key: "ACCESS_KEY_ID"
84+
# secretAccessKey:
85+
# # -- existing Kubernetes Secret to use for S3 secret key
86+
# name: "aws-creds"
87+
# # -- key in Kubernetes Secret to use for S3 secret key
88+
# key: "ACCESS_SECRET_KEY"
89+
90+
# -- schduled backups section, please see values.yaml for example
91+
scheduledBackup: {}
92+
# name: example-backup
93+
# spec:
94+
# # -- crontab style schedule to run the backups
95+
# schedule: "0 0 0 * * *"
96+
# backupOwnerReference: self
97+
# cluster:
98+
# name: pg-backup
9999

100100
certificates:
101101
server:

0 commit comments

Comments
 (0)