Add simple OpenEBS cStor chart 62/4862/1
authorTodd Malsbary <todd.malsbary@intel.com>
Thu, 12 May 2022 22:40:11 +0000 (15:40 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Fri, 13 May 2022 18:25:18 +0000 (11:25 -0700)
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I91a190aad3b5ba9224ca5eba19241110d4463f48

deploy/openebs-cstor/.helmignore [new file with mode: 0644]
deploy/openebs-cstor/Chart.yaml [new file with mode: 0644]
deploy/openebs-cstor/templates/cstorpoolcluster.yaml [new file with mode: 0644]
deploy/openebs-cstor/templates/storageclass.yaml [new file with mode: 0644]
deploy/openebs-cstor/values.yaml [new file with mode: 0644]

diff --git a/deploy/openebs-cstor/.helmignore b/deploy/openebs-cstor/.helmignore
new file mode 100644 (file)
index 0000000..0e8a0eb
--- /dev/null
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/deploy/openebs-cstor/Chart.yaml b/deploy/openebs-cstor/Chart.yaml
new file mode 100644 (file)
index 0000000..e078e4a
--- /dev/null
@@ -0,0 +1,7 @@
+# A simple chart to create a StorageClass from a single cStor pool of
+# all available block devices in the cluster. This is far from
+# optimal, but it is sufficient for getting up and running initially.
+apiVersion: v2
+name: openebs-cstor
+type: application
+version: 0.1.0
diff --git a/deploy/openebs-cstor/templates/cstorpoolcluster.yaml b/deploy/openebs-cstor/templates/cstorpoolcluster.yaml
new file mode 100644 (file)
index 0000000..55d3dd0
--- /dev/null
@@ -0,0 +1,16 @@
+apiVersion: cstor.openebs.io/v1
+kind: CStorPoolCluster
+metadata:
+ name: {{ .Release.Name }}-disk-pool
+spec:
+ pools:
+{{ range $index, $bd := (lookup "openebs.io/v1alpha1" "BlockDevice" .Release.Namespace "").items }}
+   - nodeSelector:
+       kubernetes.io/hostname: {{ $bd.spec.nodeAttributes.nodeName }}
+     dataRaidGroups:
+       - blockDevices:
+           - blockDeviceName: {{ $bd.metadata.name }}
+     poolConfig:
+       dataRaidGroupType: {{ $.Values.dataRaidGroupType }}
+{{ end }}
+
diff --git a/deploy/openebs-cstor/templates/storageclass.yaml b/deploy/openebs-cstor/templates/storageclass.yaml
new file mode 100644 (file)
index 0000000..956f1f4
--- /dev/null
@@ -0,0 +1,10 @@
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+  name: {{ .Values.storageClassName }}
+provisioner: cstor.csi.openebs.io
+allowVolumeExpansion: true
+parameters:
+  cas-type: cstor
+  cstorPoolCluster: {{ .Release.Name }}-disk-pool
+  replicaCount: {{ len (lookup "openebs.io/v1alpha1" "BlockDevice" .Release.Namespace "").items | quote }}
diff --git a/deploy/openebs-cstor/values.yaml b/deploy/openebs-cstor/values.yaml
new file mode 100644 (file)
index 0000000..861047c
--- /dev/null
@@ -0,0 +1,5 @@
+# storageClassName is the name of the created StorageClass.
+storageClassName: cstor-csi-disk
+
+# dataRaidGroupType may be either stripe or mirror.
+dataRaidGroupType: stripe