Skip to content

Commit 381b2a3

Browse files
committed
update cnpg options to match upstream chart better
1 parent 46955d1 commit 381b2a3

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
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.4.0
5+
version: 0.5.0
66

77
maintainers:
88
- name: "cloudymax"

charts/cloudnative-pg-cluster/README.md

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

3-
![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-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

@@ -34,13 +34,16 @@ Create postgres tenant clusters managed by the CNPG Operator
3434
| managed | object | `{"roles":[]}` | See https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-RoleConfiguration for explanation of all options |
3535
| monitoring.enablePodMonitor | bool | `false` | enable monitoring via Prometheus |
3636
| name | string | `"cnpg"` | |
37+
| postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 |
38+
| postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 |
3739
| 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 |
3840
| primaryUpdateStrategy | string | `"unsupervised"` | |
3941
| resources | object | `{}` | |
4042
| scheduledBackup | object | `{}` | schduled backups section, please see values.yaml for example |
4143
| storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster |
4244
| superuserSecret | string | `""` | name of existing secret to use as superuser redentials will be randomly generated if not specified. |
4345
| testApp.enabled | bool | `false` | |
46+
| type | string | `"postgresql"` | Type of the CNPG database. Available types: * `postgresql` * `postgis` * `timescaledb` |
4447

4548
----------------------------------------------
46-
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
49+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/cloudnative-pg-cluster/templates/_helpers.tpl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,31 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63+
64+
65+
66+
{{/*
67+
Postgres UID
68+
*/}}
69+
{{- define "cluster.postgresUID" -}}
70+
{{- if ge (int .Values.postgresUID) 0 -}}
71+
{{- .Values.postgresUID }}
72+
{{- else if and (eq (include "cluster.useTimescaleDBDefaults" .) "true") (eq .Values.type "timescaledb") -}}
73+
{{- 1000 -}}
74+
{{- else -}}
75+
{{- 26 -}}
76+
{{- end -}}
77+
{{- end -}}
78+
79+
{{/*
80+
Postgres GID
81+
*/}}
82+
{{- define "cluster.postgresGID" -}}
83+
{{- if ge (int .Values.postgresGID) 0 -}}
84+
{{- .Values.postgresGID }}
85+
{{- else if and (eq (include "cluster.useTimescaleDBDefaults" .) "true") (eq .Values.type "timescaledb") -}}
86+
{{- 1000 -}}
87+
{{- else -}}
88+
{{- 26 -}}
89+
{{- end -}}
90+
{{- end -}}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ kind: Cluster
44
metadata:
55
name: {{ .Values.name }}
66
spec:
7+
postgresUID: {{ include "cluster.postgresUID" . }}
8+
postgresGID: {{ include "cluster.postgresGID" . }}
79
instances: {{ .Values.instances }}
810
imageName: {{ .Values.imageName }}
911
enableSuperuserAccess: {{ .Values.enableSuperuserAccess }}

charts/cloudnative-pg-cluster/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ superuserSecret: ""
2222
# the switchover of the primary
2323
primaryUpdateStrategy: unsupervised
2424

25+
# -- Type of the CNPG database. Available types:
26+
# * `postgresql`
27+
# * `postgis`
28+
# * `timescaledb`
29+
type: postgresql
30+
2531
# -- boostrap method. see: https://cloudnative-pg.io/documentation/1.23/bootstrap/
2632
bootstrap: {}
2733
# -- for initializing a fresh cluster
@@ -135,6 +141,12 @@ certificates:
135141
username:
136142
- "app"
137143

144+
# -- The UID of the postgres user inside the image, defaults to 26
145+
postgresUID: -1
146+
147+
# -- The GID of the postgres user inside the image, defaults to 26
148+
postgresGID: -1
149+
138150
monitoring:
139151
# -- enable monitoring via Prometheus
140152
enablePodMonitor: false

0 commit comments

Comments
 (0)