Skip to content

Commit e601657

Browse files
committed
feat: add tablespaces support
Add tablespaces support in `Cluster` resource. https://cloudnative-pg.io/docs/1.28/tablespaces
1 parent 6579321 commit e601657

5 files changed

Lines changed: 37 additions & 0 deletions

File tree

charts/cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
194194
| cluster.storage.size | string | `"8Gi"` | |
195195
| cluster.storage.storageClass | string | `""` | |
196196
| cluster.superuserSecret | string | `""` | |
197+
| cluster.tablespaces | list | `[]` | Tablespaces configuration Ref: https://cloudnative-pg.io/docs/1.28/cloudnative-pg.v1/#tablespaceconfiguration |
197198
| cluster.walStorage.enabled | bool | `false` | |
198199
| cluster.walStorage.size | string | `"1Gi"` | |
199200
| cluster.walStorage.storageClass | string | `""` | |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type: postgresql
2+
mode: standalone
3+
version:
4+
postgresql: "16"
5+
cluster:
6+
instances: 1
7+
backups:
8+
enabled: false
9+
tablespaces:
10+
- name: analytics_data
11+
storage:
12+
size: 50Gi
13+
storageClass: local-path
14+
temporary: false
15+
- name: my_temp_space
16+
storage:
17+
size: 20Gi
18+
temporary: true

charts/cluster/templates/cluster.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ spec:
3434
storageClass: {{ .Values.cluster.walStorage.storageClass }}
3535
{{- end }}
3636
{{- end }}
37+
{{- with .Values.tablespaces }}
38+
tablespaces:
39+
{{- toYaml . | nindent 4 }}
40+
{{- end }}
3741
{{- with .Values.cluster.resources }}
3842
resources:
3943
{{- toYaml . | nindent 4 }}

charts/cluster/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@
340340
"superuserSecret": {
341341
"type": "string"
342342
},
343+
"tablespaces": {
344+
"type": "array"
345+
},
343346
"walStorage": {
344347
"type": "object",
345348
"properties": {

charts/cluster/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ cluster:
210210
size: 1Gi
211211
storageClass: ""
212212

213+
# -- Tablespaces configuration
214+
# Ref: https://cloudnative-pg.io/docs/1.28/cloudnative-pg.v1/#tablespaceconfiguration
215+
tablespaces: []
216+
# - name: fast_ssd
217+
# storage:
218+
# size: 10Gi
219+
# storageClass: premium-rwo
220+
# owner:
221+
# name: app
222+
# temporary: false
223+
213224
# -- The UID of the postgres user inside the image, defaults to 26
214225
postgresUID: -1
215226

0 commit comments

Comments
 (0)