Skip to content

Commit

Permalink
[helm][storageclass]: replace replicaNumber with enableHA
Browse files Browse the repository at this point in the history
  • Loading branch information
mingming.zhou committed Aug 11, 2022
1 parent 754e98e commit 35b1d82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion helm/hwameistor/templates/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{{- define "replicaNumber" -}}
{{- if .Values.storageClass.enableHA -}}
{{- print 2 -}}
{{- else -}}
{{- print 1 -}}
{{- end -}}
{{- end -}}

{{- if .Values.storageClass.enabled -}}
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -10,7 +18,7 @@ volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
parameters:
replicaNumber: {{ .Values.storageClass.replicaNumber | quote}}
replicaNumber: {{ include "replicaNumber" . | quote}}
poolClass: {{ .Values.storageClass.diskType | quote}}
poolType: "REGULAR"
volumeKind: "LVM"
Expand Down
4 changes: 2 additions & 2 deletions helm/hwameistor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ storageClass:
allowVolumeExpansion: true
convertible: false
reclaimPolicy: Delete
# If value >1, means enable volumeHA, you need install drbd kernel module on each node first
replicaNumber: 1
# If enabled, you need install drbd kernel module on each node first
enableHA: false
# Represent which kind disk will be used to provision volume
diskType: HDD
fsType: xfs
Expand Down

0 comments on commit 35b1d82

Please sign in to comment.