Skip to content

Commit af24140

Browse files
Max Robyjessebot
authored andcommitted
add external cluster fields - use .Release.Namespace for test app
1 parent ec2511a commit af24140

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

charts/cloudnative-pg-cluster/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 |
@@ -45,7 +45,6 @@ Create postgres tenant clusters managed by the CNPG Operator
4545
| storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster |
4646
| superuserSecret.name | string | `"superuser-secret"` | |
4747
| testApp.enabled | bool | `false` | |
48-
| testApp.namespace | string | `"default"` | |
4948

5049
----------------------------------------------
5150
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: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,50 @@ name: "cnpg"
22

33
instances: 3
44

5-
superuserSecret:
6-
name: superuser-secret
5+
#superuserSecret:
6+
# name: superuser-secret
77

88
bootstrap:
99
initdb:
1010
# -- initial database to create
1111
database: app
1212
# -- owner of the initial database that is created above
1313
owner: app
14-
secret:
15-
name: app-secret
14+
# secret:
15+
# name: app-secret
1616
# list of SQL commands to run as part of the init scripts, example:
1717
# postInitSQL:
1818
# - CREATE ROLE friend
19+
# Specify an external cluster to bootstrap from
20+
# recovery:
21+
# source: clusterBackup
22+
23+
#externalClusters:
24+
# # -- name of external/existing cluster
25+
# - name: clusterBackup
26+
# barmanObjectStore:
27+
# destinationPath: "s3://backups"
28+
# endpointURL: "http://HOST:PORT"
29+
# s3Credentials:
30+
# accessKeyId:
31+
# # -- existing Kubernetes Secret to use for S3 access key ID
32+
# name: "aws-creds"
33+
# # -- key in Kubernetes Secret to use for S3 access key ID
34+
# key: "ACCESS_KEY_ID"
35+
# secretAccessKey:
36+
# # -- existing Kubernetes Secret to use for S3 secret key
37+
# name: "aws-creds"
38+
# # -- key in Kubernetes Secret to use for S3 secret key
39+
# key: "ACCESS_SECRET_KEY"
40+
# wal:
41+
# maxParallel: 8
1942

2043
backup:
2144
# -- how long to keep backups for
2245
retentionPolicy: "30d"
2346
barmanObjectStore:
24-
destinationPath: "backups"
47+
destinationPath: "s3://backups"
48+
endpointURL: "http://HOST:PORT"
2549
s3Credentials:
2650
accessKeyId:
2751
# -- existing Kubernetes Secret to use for S3 access key ID
@@ -96,5 +120,3 @@ testApp:
96120
# Populates user and DB from the Initdb owner and database values
97121
# Requires server, client, and user certificate generation to be enabled.
98122
enabled: false
99-
## -- namespace where the read-write postgres service exists
100-
namespace: "default"

0 commit comments

Comments
 (0)