From 06390022108e81952393a24503311d401ec42634 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 3 Aug 2022 11:45:37 -0500 Subject: [PATCH] OpenEBS --- .../initialization/openebs-jiva/config.yaml | 13 ++++++++ .../openebs-jiva/daemonset.yaml | 12 +++++++ .../openebs-jiva/kustomization.yaml | 7 ++++ .../openebs-jiva/storage-class.yaml | 33 +++++++++++++++++++ .../openebs-jiva/volume-policy.yaml | 9 +++++ 5 files changed, 74 insertions(+) create mode 100644 home/manifests/initialization/openebs-jiva/config.yaml create mode 100644 home/manifests/initialization/openebs-jiva/daemonset.yaml create mode 100644 home/manifests/initialization/openebs-jiva/storage-class.yaml create mode 100644 home/manifests/initialization/openebs-jiva/volume-policy.yaml diff --git a/home/manifests/initialization/openebs-jiva/config.yaml b/home/manifests/initialization/openebs-jiva/config.yaml new file mode 100644 index 0000000..e4f5f98 --- /dev/null +++ b/home/manifests/initialization/openebs-jiva/config.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/managed-by: pulumi + name: openebs-jiva-csi-iscsiadm + namespace: openebs +data: + iscsiadm: | + #!/bin/sh + iscsid_pid=$(pgrep iscsid) + + nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- /usr/local/sbin/iscsiadm "$@" diff --git a/home/manifests/initialization/openebs-jiva/daemonset.yaml b/home/manifests/initialization/openebs-jiva/daemonset.yaml new file mode 100644 index 0000000..ac6a5bc --- /dev/null +++ b/home/manifests/initialization/openebs-jiva/daemonset.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: openebs-jiva-csi-node + labels: + app: openebs-jiva-csi-node + namespace: openebs +spec: + template: + spec: + hostPID: true diff --git a/home/manifests/initialization/openebs-jiva/kustomization.yaml b/home/manifests/initialization/openebs-jiva/kustomization.yaml index f24c8ad..2afce0b 100644 --- a/home/manifests/initialization/openebs-jiva/kustomization.yaml +++ b/home/manifests/initialization/openebs-jiva/kustomization.yaml @@ -4,6 +4,13 @@ kind: Kustomization resources: # - namespace.yaml - https://openebs.github.io/charts/openebs-operator.yaml + #- https://openebs.github.io/charts/hostpath-operator.yaml + #- https://openebs.github.io/charts/jiva-operator.yaml + - ./volume-policy.yaml + #- ./storage-class.yaml # - https://openebs.github.io/charts/cstor-operator.yaml # - https://openebs.github.io/charts/zfs-operator.yaml # - https://openebs.github.io/charts/lvm-operator.yaml +# patchesStrategicMerge: + # - ./daemonset.yaml + #- ./config.yaml diff --git a/home/manifests/initialization/openebs-jiva/storage-class.yaml b/home/manifests/initialization/openebs-jiva/storage-class.yaml new file mode 100644 index 0000000..ca2eeac --- /dev/null +++ b/home/manifests/initialization/openebs-jiva/storage-class.yaml @@ -0,0 +1,33 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-jiva-csi-sc +provisioner: jiva.csi.openebs.io +allowVolumeExpansion: true +parameters: + cas-type: "jiva" + policy: "example-jivavolumepolicy" +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-hostpath + annotations: + openebs.io/cas-type: local + cas.openebs.io/config: | + # hostpath type will create a PV by + # creating a sub-directory under the + # BASEPATH provided below. + - name: StorageType + value: "hostpath" + # Specify the location (directory) where + # where PV(volume) data will be saved. + # A sub-directory with pv-name will be + # created. When the volume is deleted, + # the PV sub-directory will be deleted. + #Default value is /var/openebs/local + - name: BasePath + value: "/var/openebs/local/" +provisioner: openebs.io/local +volumeBindingMode: WaitForFirstConsumer +reclaimPolicy: Delete diff --git a/home/manifests/initialization/openebs-jiva/volume-policy.yaml b/home/manifests/initialization/openebs-jiva/volume-policy.yaml new file mode 100644 index 0000000..5aa7e3f --- /dev/null +++ b/home/manifests/initialization/openebs-jiva/volume-policy.yaml @@ -0,0 +1,9 @@ +apiVersion: openebs.io/v1alpha1 +kind: JivaVolumePolicy +metadata: + name: example-jivavolumepolicy + namespace: openebs +spec: + replicaSC: openebs-hostpath + target: + replicationFactor: 1