Skip to content

Commit 4febe31

Browse files
authored
Merge pull request #23 from small-hack/add-externalCluster
Add externalCluster field, remove testapp.namespace
2 parents ec2511a + a084582 commit 4febe31

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
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.4
5+
version: 0.3.5
66

77
maintainers:
88
- name: "cloudymax"

charts/cloudnative-pg-cluster/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cnpg-cluster
22

3-
![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
44

55
Create postgres tenant clusters managed by the CNPG Operator
66

@@ -15,15 +15,15 @@ Create postgres tenant clusters managed by the CNPG Operator
1515

1616
| Key | Type | Default | Description |
1717
|-----|------|---------|-------------|
18-
| backup.barmanObjectStore.destinationPath | string | `"backups"` | |
18+
| backup.barmanObjectStore.destinationPath | string | `"s3://backups"` | |
19+
| backup.barmanObjectStore.endpointURL | string | `"http://HOST:PORT"` | |
1920
| backup.barmanObjectStore.s3Credentials.accessKeyId.key | string | `"ACCESS_KEY_ID"` | key in Kubernetes Secret to use for S3 access key ID |
2021
| backup.barmanObjectStore.s3Credentials.accessKeyId.name | string | `"aws-creds"` | existing Kubernetes Secret to use for S3 access key ID |
2122
| backup.barmanObjectStore.s3Credentials.secretAccessKey.key | string | `"ACCESS_SECRET_KEY"` | key in Kubernetes Secret to use for S3 secret key |
2223
| backup.barmanObjectStore.s3Credentials.secretAccessKey.name | string | `"aws-creds"` | existing Kubernetes Secret to use for S3 secret key |
2324
| backup.retentionPolicy | string | `"30d"` | how long to keep backups for |
2425
| bootstrap.initdb.database | string | `"app"` | initial database to create |
2526
| bootstrap.initdb.owner | string | `"app"` | owner of the initial database that is created above |
26-
| bootstrap.initdb.secret.name | string | `"app-secret"` | |
2727
| certificates.client.clientCASecret | string | `""` | name of existing Kubernetes Secret for the postgresql client Certificate Authority cert, ignored if certificates.generate is true |
2828
| certificates.client.enabled | bool | `false` | enable using client certificates |
2929
| certificates.client.generate | bool | `false` | generate client certs using cert-manager. if true the following are ignored: certificates.clientCASecret, certificates.replicationTLSSecret |
@@ -43,9 +43,7 @@ Create postgres tenant clusters managed by the CNPG Operator
4343
| scheduledBackup.spec.cluster.name | string | `"pg-backup"` | |
4444
| scheduledBackup.spec.schedule | string | `"0 0 0 * * *"` | crontab style schedule to run the backups |
4545
| storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster |
46-
| superuserSecret.name | string | `"superuser-secret"` | |
4746
| testApp.enabled | bool | `false` | |
48-
| testApp.namespace | string | `"default"` | |
4947

5048
----------------------------------------------
5149
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ spec:
1111
{{- toYaml . | nindent 4 }}
1212
{{- end }}
1313
{{- end }}
14+
{{- if .Values.externalClusters }}
15+
externalClusters:
16+
{{- range $reg, $props := .Values.externalClusters }}
17+
- name: {{ $props.name }}
18+
{{- toYaml . | nindent 6 }}
19+
{{- end }}
20+
{{- end }}
1421
monitoring:
1522
enablePodMonitor: {{ .Values.monitoring.enablePodMonitor }}
1623
{{- with .Values.postgresql }}

charts/cloudnative-pg-cluster/templates/test-app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
sslkey=/etc/secrets/app/tls.key
3030
sslcert=/etc/secrets/app/tls.crt
3131
sslrootcert=/etc/secrets/ca/ca.crt
32-
host={{ .Values.name }}-rw.{{ .Values.testApp.namespace }}.svc
32+
host={{ .Values.name }}-rw.{{ .Release.Namespace }}.svc
3333
dbname={{ .Values.bootstrap.initdb.database }}
3434
user={{ .Values.bootstrap.initdb.owner }}
3535
sslmode=verify-full

charts/cloudnative-pg-cluster/values.yaml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,47 @@ name: "cnpg"
22

33
instances: 3
44

5-
superuserSecret:
6-
name: superuser-secret
7-
85
bootstrap:
96
initdb:
107
# -- initial database to create
118
database: app
129
# -- owner of the initial database that is created above
1310
owner: app
14-
secret:
15-
name: app-secret
11+
# secret:
12+
# name: app-secret
1613
# list of SQL commands to run as part of the init scripts, example:
1714
# postInitSQL:
1815
# - CREATE ROLE friend
16+
# Specify an external cluster to bootstrap from
17+
# recovery:
18+
# source: clusterBackup
19+
20+
externalClusters: []
21+
# # -- name of external/existing cluster
22+
# - name: clusterBackup
23+
# barmanObjectStore:
24+
# destinationPath: "s3://backups"
25+
# endpointURL: "http://HOST:PORT"
26+
# s3Credentials:
27+
# accessKeyId:
28+
# # -- existing Kubernetes Secret to use for S3 access key ID
29+
# name: "aws-creds"
30+
# # -- key in Kubernetes Secret to use for S3 access key ID
31+
# key: "ACCESS_KEY_ID"
32+
# secretAccessKey:
33+
# # -- existing Kubernetes Secret to use for S3 secret key
34+
# name: "aws-creds"
35+
# # -- key in Kubernetes Secret to use for S3 secret key
36+
# key: "ACCESS_SECRET_KEY"
37+
# wal:
38+
# maxParallel: 8
1939

2040
backup:
2141
# -- how long to keep backups for
2242
retentionPolicy: "30d"
2343
barmanObjectStore:
24-
destinationPath: "backups"
44+
destinationPath: "s3://backups"
45+
endpointURL: "http://HOST:PORT"
2546
s3Credentials:
2647
accessKeyId:
2748
# -- existing Kubernetes Secret to use for S3 access key ID
@@ -96,5 +117,3 @@ testApp:
96117
# Populates user and DB from the Initdb owner and database values
97118
# Requires server, client, and user certificate generation to be enabled.
98119
enabled: false
99-
## -- namespace where the read-write postgres service exists
100-
namespace: "default"

0 commit comments

Comments
 (0)