Skip to content

Commit

Permalink
[Issue 5857][Helm Chart] - Support to existing Storage Class with Sto…
Browse files Browse the repository at this point in the history
…rageClassName (apache#5860)

Fixes apache#5857 

### Motivation

With current aproach for specifying storage class in persistent volume claim it's not possible to customize the provisioner parameters. If the property 'storageClass' is declared the chart always create a new storage class with hardcoded parameters.

### Modifications

A property 'storageClassName' was added to support an existent storage class.

### Verifying this change

This change is a trivial rework / code cleanup without any test coverage.
  • Loading branch information
SakaSun authored and sijie committed Dec 20, 2019
1 parent a958098 commit e18463f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ spec:
resources:
requests:
storage: {{ .Values.bookkeeper.volumes.journal.size }}
{{- if .Values.bookkeeper.volumes.journal.storageClass }}
{{- if .Values.bookkeeper.volumes.journal.storageClassName }}
storageClassName: "{{ .Values.bookkeeper.volumes.journal.storageClassName }}"
{{- else if .Values.bookkeeper.volumes.journal.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.journal.name }}"
{{- end }}
- metadata:
Expand All @@ -153,7 +155,9 @@ spec:
resources:
requests:
storage: {{ .Values.bookkeeper.volumes.ledgers.size }}
{{- if .Values.bookkeeper.volumes.ledgers.storageClass }}
{{- if .Values.bookkeeper.volumes.ledgers.storageClassName }}
storageClassName: "{{ .Values.bookkeeper.volumes.ledgers.storageClassName }}"
{{- else if .Values.bookkeeper.volumes.ledgers.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}"
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ spec:
requests:
storage: {{ .Values.prometheus.volumes.data.size }}
accessModes: [ "ReadWriteOnce" ]
{{- if .Values.prometheus.volumes.data.storageClass }}
{{- if .Values.prometheus.volumes.data.storageClassName }}
storageClassName: "{{ .Values.prometheus.volumes.data.storageClassName }}"
{{- else if .Values.prometheus.volumes.data.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ spec:
resources:
requests:
storage: {{ .Values.zookeeper.volumes.data.size }}
{{- if .Values.zookeeper.volumes.data.storageClass }}
{{- if .Values.zookeeper.volumes.data.storageClassName }}
storageClassName: "{{ .Values.zookeeper.volumes.data.storageClassName }}"
{{- else if .Values.zookeeper.volumes.data.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.data.name }}"
{{- end }}
{{- end }}
32 changes: 24 additions & 8 deletions deployment/kubernetes/helm/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ zookeeper:
data:
name: data
size: 20Gi
## If the storage class is left undefined when using persistence
## the default storage class for the cluster will be used.
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-ssd
Expand Down Expand Up @@ -146,8 +150,12 @@ bookkeeper:
journal:
name: journal
size: 50Gi
## If the storage class is left undefined when using persistence
## the default storage class for the cluster will be used.
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-ssd
Expand All @@ -156,8 +164,12 @@ bookkeeper:
ledgers:
name: ledgers
size: 50Gi
## If the storage class is left undefined when using persistence
## the default storage class for the cluster will be used.
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-ssd
Expand Down Expand Up @@ -387,8 +399,12 @@ prometheus:
data:
name: data
size: 50Gi
## If the storage class is left undefined when using persistence
## the default storage class for the cluster will be used.
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-standard
Expand Down

0 comments on commit e18463f

Please sign in to comment.