Skip to content

Commit 605a8ec

Browse files
committed
add ability to set storage class for cluster PVC
1 parent e131d29 commit 605a8ec

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

charts/cloudnative-pg-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Create postgres tenant clusters managed by the CNPG Operator
4343
| resources | object | `{}` | |
4444
| scheduledBackup | object | `{}` | schduled backups section, please see values.yaml for example |
4545
| storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster |
46+
| storage.storageClass | string | `"default"` | set the storage class of the PVC. |
4647
| superuserSecret | string | `""` | name of existing secret to use as superuser redentials will be randomly generated if not specified. |
4748
| testApp.enabled | bool | `false` | |
4849
| type | string | `"postgresql"` | Type of the CNPG database. Available types: * `postgresql` * `postgis` * `timescaledb` |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ spec:
4141
{{- end }}
4242
storage:
4343
size: {{ .Values.storage.size }}
44+
{{- if ne .Values.storage.storageClass "default" }}
45+
storageClass: {{ .Values.storage.storageClass }}
46+
{{- end }}
4447
{{- with .Values.bootstrap }}
4548
bootstrap:
4649
{{- toYaml . | nindent 4 }}

charts/cloudnative-pg-cluster/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ postgresql:
168168
storage:
169169
# -- how much storage to allocate to the postgresql cluster
170170
size: 1Gi
171+
# -- set the storage class of the PVC.
172+
storageClass: default
171173

172174
# from https://cloudnative-pg.io/documentation/1.22/resource_management/
173175
resources: {}

0 commit comments

Comments
 (0)