From cbf08842fc1322a21673cdd4974bc76f5e288914 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 14 Oct 2024 20:08:31 -0400 Subject: [PATCH] feat: add openebs zfs-localpv --- kubernetes/main/core/kustomization.yaml | 2 +- .../main/core/openebs/app/helm-release.yaml | 59 +++++++++++++++++++ .../core/openebs/app/helm-repository.yaml | 17 ++++++ .../main/core/openebs/app/kustomization.yaml | 7 +++ .../openebs/app/monitoring-helm-release.yaml | 39 ++++++++++++ .../main/core/openebs/app/namespace.yaml | 4 ++ kubernetes/main/core/openebs/ks.yaml | 54 +++++++++++++++++ .../{ => storage-class}/kustomization.yaml | 4 +- .../{ => storage-class}/mainpool-sc.yaml | 0 .../storage-class/zfs-mainpool-sc.yaml | 7 +++ 10 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 kubernetes/main/core/openebs/app/helm-release.yaml create mode 100644 kubernetes/main/core/openebs/app/helm-repository.yaml create mode 100644 kubernetes/main/core/openebs/app/kustomization.yaml create mode 100644 kubernetes/main/core/openebs/app/monitoring-helm-release.yaml create mode 100644 kubernetes/main/core/openebs/app/namespace.yaml create mode 100644 kubernetes/main/core/openebs/ks.yaml rename kubernetes/main/core/openebs/{ => storage-class}/kustomization.yaml (59%) rename kubernetes/main/core/openebs/{ => storage-class}/mainpool-sc.yaml (100%) create mode 100644 kubernetes/main/core/openebs/storage-class/zfs-mainpool-sc.yaml diff --git a/kubernetes/main/core/kustomization.yaml b/kubernetes/main/core/kustomization.yaml index 2df2bd3..a916627 100644 --- a/kubernetes/main/core/kustomization.yaml +++ b/kubernetes/main/core/kustomization.yaml @@ -8,7 +8,7 @@ resources: - ./traefik/ks.yaml # storage - ./longhorn -- ./openebs +- ./openebs/ks.yaml - ./kube-replicator diff --git a/kubernetes/main/core/openebs/app/helm-release.yaml b/kubernetes/main/core/openebs/app/helm-release.yaml new file mode 100644 index 0000000..4952137 --- /dev/null +++ b/kubernetes/main/core/openebs/app/helm-release.yaml @@ -0,0 +1,59 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: openebs + namespace: openebs-system +spec: + interval: 5m + chart: + spec: + chart: openebs + version: 4.1.0 + sourceRef: + kind: HelmRepository + name: openebs + namespace: flux-system + values: + openebs-crds: + csi: + volumeSnapshots: + enabled: false + keep: false + + zfs-localpv: + crds: + zfsLocalPv: + enabled: true + csi: + volumeSnapshots: + enabled: false + + # Refer to https://github.com/openebs/dynamic-localpv-provisioner/blob/HEAD/deploy/helm/charts/values.yaml for complete set of values. + localpv-provisioner: + rbac: + create: true + + # Refer to https://github.com/openebs/lvm-localpv/blob/lvm-localpv-1.6.2/deploy/helm/charts/values.yaml for complete set of values. + lvm-localpv: + crds: + lvmLocalPv: + enabled: false + csi: + volumeSnapshots: + enabled: false + + # Refer to https://github.com/openebs/mayastor-extensions/blob/v2.7.0/chart/values.yaml for complete set of values. + mayastor: + enabled: false + + engines: + local: + lvm: + enabled: false + zfs: + enabled: true + replicated: + mayastor: + enabled: false + diff --git a/kubernetes/main/core/openebs/app/helm-repository.yaml b/kubernetes/main/core/openebs/app/helm-repository.yaml new file mode 100644 index 0000000..f9bc8cf --- /dev/null +++ b/kubernetes/main/core/openebs/app/helm-repository.yaml @@ -0,0 +1,17 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: openebs + namespace: flux-system +spec: + interval: 1m + url: https://openebs.github.io/openebs +--- +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: openebs-monitoring + namespace: flux-system +spec: + interval: 1m + url: https://openebs.github.io/monitoring \ No newline at end of file diff --git a/kubernetes/main/core/openebs/app/kustomization.yaml b/kubernetes/main/core/openebs/app/kustomization.yaml new file mode 100644 index 0000000..dec9b5f --- /dev/null +++ b/kubernetes/main/core/openebs/app/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./namespace.yaml +- ./helm-repository.yaml +- ./helm-release.yaml +- ./monitoring-helm-release.yaml \ No newline at end of file diff --git a/kubernetes/main/core/openebs/app/monitoring-helm-release.yaml b/kubernetes/main/core/openebs/app/monitoring-helm-release.yaml new file mode 100644 index 0000000..89c6f3b --- /dev/null +++ b/kubernetes/main/core/openebs/app/monitoring-helm-release.yaml @@ -0,0 +1,39 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: openebs-monitoring + namespace: openebs-system +spec: + interval: 5m + chart: + spec: + chart: openebs-monitoring + version: 0.4.13 + sourceRef: + kind: HelmRepository + name: openebs-monitoring-charts + namespace: flux-system + + values: + kube-prometheus-stack: + install: false + + openebsMonitoringAddon: + # this is the only provisioner enabled + localPV: + enabled: true + + cStore: + enabled: false + jiva: + enabled: false + ndm: + enabled: false + npd: + enabled: false + deviceLocalPV: + enabled: false + lvmLocalPV: + enabled: false + zfsLocalPV: + enabled: true \ No newline at end of file diff --git a/kubernetes/main/core/openebs/app/namespace.yaml b/kubernetes/main/core/openebs/app/namespace.yaml new file mode 100644 index 0000000..d71ed8c --- /dev/null +++ b/kubernetes/main/core/openebs/app/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: openebs-system \ No newline at end of file diff --git a/kubernetes/main/core/openebs/ks.yaml b/kubernetes/main/core/openebs/ks.yaml new file mode 100644 index 0000000..982bcb4 --- /dev/null +++ b/kubernetes/main/core/openebs/ks.yaml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: openebs + namespace: flux-system +spec: + targetNamespace: openebs-system + timeout: 5m + interval: 10m + path: ./kubernetes/main/core/openebs/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: openebs-sc + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/main/core/openebs/storage-class + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets \ No newline at end of file diff --git a/kubernetes/main/core/openebs/kustomization.yaml b/kubernetes/main/core/openebs/storage-class/kustomization.yaml similarity index 59% rename from kubernetes/main/core/openebs/kustomization.yaml rename to kubernetes/main/core/openebs/storage-class/kustomization.yaml index 334016a..270fa13 100644 --- a/kubernetes/main/core/openebs/kustomization.yaml +++ b/kubernetes/main/core/openebs/storage-class/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- ../../../common/apps/openebs -- ./mainpool-sc.yaml \ No newline at end of file +- ./mainpool-sc.yaml +- ./zfs-mainpool-sc.yaml \ No newline at end of file diff --git a/kubernetes/main/core/openebs/mainpool-sc.yaml b/kubernetes/main/core/openebs/storage-class/mainpool-sc.yaml similarity index 100% rename from kubernetes/main/core/openebs/mainpool-sc.yaml rename to kubernetes/main/core/openebs/storage-class/mainpool-sc.yaml diff --git a/kubernetes/main/core/openebs/storage-class/zfs-mainpool-sc.yaml b/kubernetes/main/core/openebs/storage-class/zfs-mainpool-sc.yaml new file mode 100644 index 0000000..39e23aa --- /dev/null +++ b/kubernetes/main/core/openebs/storage-class/zfs-mainpool-sc.yaml @@ -0,0 +1,7 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-zfs-mainpool +parameters: + poolname: "MainPool/openebs-zfs" +provisioner: zfs.csi.openebs.io \ No newline at end of file