Skip to content

Commit

Permalink
fix: set global storageClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
g1eny0ung committed Oct 19, 2023
1 parent 126dda5 commit 4f3bda6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
30 changes: 30 additions & 0 deletions charts/hstreamdb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,33 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Below are custom templates for hstreamdb.
*/}}

{{/*
Create volumeClaimTemplate for hstore.
*/}}
{{- define "hstreamdb.hstore.volumeClaimTemplate" -}}
{{- $globalStorageClassName := default "standard" .Values.storageClassName }}
spec:
storageClassName: {{ print $globalStorageClassName }}
resources:
requests:
storage: {{ .Values.hstore.storage }}
{{- end }}

{{/*
Create volumeClaimTemplate for hmeta.
*/}}
{{- define "hstreamdb.hmeta.volumeClaimTemplate" -}}
{{- $globalStorageClassName := default "standard" .Values.storageClassName }}
spec:
storageClassName: {{ print $globalStorageClassName }}
resources:
requests:
storage: {{ .Values.hmeta.storage }}
{{- end }}
13 changes: 3 additions & 10 deletions charts/hstreamdb/templates/hstreamdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ kind: HStreamDB
metadata:
name: {{ include "hstreamdb.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "hstreamdb.labels" . | nindent 4 }}
labels: {{- include "hstreamdb.labels" . | nindent 4 }}
spec:
hserver:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand All @@ -18,10 +17,7 @@ spec:
replicas: {{ .Values.hstore.replicaCount }}
container:
name: {{ .Values.hstore.name }}
volumeClaimTemplate:
{{- with .Values.hstore.volumeClaimTemplate }}
{{- toYaml . | nindent 6 }}
{{- end }}
volumeClaimTemplate: {{- include "hstreamdb.hstore.volumeClaimTemplate" . | indent 6 }}
adminServer:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand All @@ -34,7 +30,4 @@ spec:
replicas: {{ .Values.hmeta.replicaCount }}
container:
name: {{ .Values.hmeta.name }}
volumeClaimTemplate:
{{- with .Values.hmeta.volumeClaimTemplate }}
{{- toYaml . | nindent 6 }}
{{- end }}
volumeClaimTemplate: {{- include "hstreamdb.hmeta.volumeClaimTemplate" . | indent 6 }}
20 changes: 5 additions & 15 deletions charts/hstreamdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,14 @@ hserver:
name: hserver
replicaCount: 3

storageClassName: &globalStorageClassName "standard"
storageClassName: "standard"

hstore:
# Name of the hstore component.
name: hstore
replicaCount: 3
volumeClaimTemplate:
# The spec of the PersistentVolumeClaim to create. Must be set.
spec:
storageClassName: *globalStorageClassName
resources:
requests:
storage: 5Gi
# Storage size for PVC requests. Must be set.
storage: 5Gi

adminServer:
# Name of the admin-server component.
Expand All @@ -126,13 +121,8 @@ hmeta:
# Name of the hmeta component.
name: hmeta
replicaCount: 3
volumeClaimTemplate:
# The spec of the PersistentVolumeClaim to create. Must be set.
spec:
storageClassName: *globalStorageClassName
resources:
requests:
storage: 1Gi
# Storage size for PVC requests. Must be set.
storage: 1Gi
rqlite:
version: 7.21.4

Expand Down

0 comments on commit 4f3bda6

Please sign in to comment.