Skip to content

Commit

Permalink
add support for bootstrap and initdb options
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Roby committed Nov 2, 2023
1 parent 8353cac commit 472dbe8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/cloudnative-pg-tenant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cnpg-tenant
description: Create postgres tenant clusters managed by the CNPG Operator
type: application
version: 0.0.1
version: 0.0.2

maintainers:
- name: "cloudymax"
Expand Down
7 changes: 6 additions & 1 deletion charts/cloudnative-pg-tenant/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cnpg-tenant

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Create postgres tenant clusters managed by the CNPG Operator

Expand All @@ -20,6 +20,10 @@ Create postgres tenant clusters managed by the CNPG Operator
| backup.s3Credentials.accessKeyId.name | string | `"aws-creds"` | |
| backup.s3Credentials.secretAccessKey.key | string | `"ACCESS_SECRET_KEY"` | |
| backup.s3Credentials.secretAccessKey.name | string | `"aws-creds"` | |
| bootstrap.initdb.database | string | `"app"` | |
| bootstrap.initdb.owner | string | `"app"` | |
| bootstrap.initdb.postInitSQL[0] | string | `"CREATE ROLE friend"` | |
| bootstrap.initdb.secret.name | string | `"app-secret"` | |
| instances | int | `3` | |
| monitoring.enablePodMonitor | bool | `true` | |
| name | string | `"example"` | |
Expand All @@ -30,6 +34,7 @@ Create postgres tenant clusters managed by the CNPG Operator
| scheduledBackup.spec.cluster.name | string | `"pg-backup"` | |
| scheduledBackup.spec.schedule | string | `"0 0 0 * * *"` | |
| storage.size | string | `"1Gi"` | |
| superuserSecret.name | string | `"superuser-secret"` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
10 changes: 7 additions & 3 deletions charts/cloudnative-pg-tenant/templates/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ spec:
retentionPolicy: {{ .Values.backup.retentionPolicy }}
monitoring:
enablePodMonitor: {{ .Values.monitoring.enablePodMonitor }}
{{- with .Values.postgresql }}
postgresql:
pg_hba:
- hostnossl all all 0.0.0.0/0 reject
- hostssl all all 0.0.0.0/0 cert clientcert=verify-full
{{- toYaml . | nindent 4}}
{{- end }}
storage:
size: {{ .Values.storage.size }}
{{- with .Values.bootstrap }}
bootstrap:
{{- toYaml . | nindent 4 }}
{{- end }}
---
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
Expand Down
12 changes: 12 additions & 0 deletions charts/cloudnative-pg-tenant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ name: "example"

instances: 3

superuserSecret:
name: superuser-secret

bootstrap:
initdb:
database: app
owner: app
secret:
name: app-secret
postInitSQL:
- CREATE ROLE friend

backup:
destinationPath: "backups"
retentionPolicy: "30d"
Expand Down

0 comments on commit 472dbe8

Please sign in to comment.