From d002d884dad39b62270cd81c07296cbfb1bd693b Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 17 Jun 2024 16:24:50 -0400 Subject: [PATCH] feat: create a openebs hostpath storage class with its base path on the zfs pool --- cluster/apps/database/redis/helm-release.yaml | 4 ++-- cluster/apps/dev/forgejo-runner/runner.yaml | 2 +- cluster/apps/dev/woodpecker/helm-release.yaml | 4 ++-- .../apps/media/audiobookshelf/helm-release.yaml | 2 +- .../kube-prometheus-stack/helm-release.yaml | 2 +- cluster/core/storage/openebs/kustomization.yaml | 1 + cluster/core/storage/openebs/mainpool-sc.yaml | 14 ++++++++++++++ 7 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 cluster/core/storage/openebs/mainpool-sc.yaml diff --git a/cluster/apps/database/redis/helm-release.yaml b/cluster/apps/database/redis/helm-release.yaml index 87542df..b92753a 100644 --- a/cluster/apps/database/redis/helm-release.yaml +++ b/cluster/apps/database/redis/helm-release.yaml @@ -29,7 +29,7 @@ spec: persistence: enabled: true - storageClass: openebs-hostpath + storageClass: mainpool-hostpath size: 8Gi replica: @@ -43,5 +43,5 @@ spec: persistence: enabled: true - storageClass: openebs-hostpath + storageClass: mainpool-hostpath size: 8Gi \ No newline at end of file diff --git a/cluster/apps/dev/forgejo-runner/runner.yaml b/cluster/apps/dev/forgejo-runner/runner.yaml index 3ca9d01..f646e67 100644 --- a/cluster/apps/dev/forgejo-runner/runner.yaml +++ b/cluster/apps/dev/forgejo-runner/runner.yaml @@ -13,7 +13,7 @@ spec: - metadata: name: runner-work spec: - storageClassName: openebs-hostpath + storageClassName: mainpool-hostpath accessModes: - ReadWriteOnce resources: diff --git a/cluster/apps/dev/woodpecker/helm-release.yaml b/cluster/apps/dev/woodpecker/helm-release.yaml index 54a0f62..33f5412 100644 --- a/cluster/apps/dev/woodpecker/helm-release.yaml +++ b/cluster/apps/dev/woodpecker/helm-release.yaml @@ -29,7 +29,7 @@ spec: WOODPECKER_BACKEND: kubernetes WOODPECKER_SERVER: woodpecker-server.dev.svc.cluster.local:9000 WOODPECKER_BACKEND_K8S_NAMESPACE: dev - WOODPECKER_BACKEND_K8S_STORAGE_CLASS: openebs-hostpath + WOODPECKER_BACKEND_K8S_STORAGE_CLASS: mainpool-hostpath WOODPECKER_BACKEND_K8S_VOLUME_SIZE: 5G WOODPECKER_BACKEND_K8S_STORAGE_RWX: false WOODPECKER_BACKEND_K8S_POD_LABELS: "" @@ -53,7 +53,7 @@ spec: enabled: true size: 10Gi mountPath: '/var/lib/woodpecker' - storageClass: openebs-hostpath + storageClass: mainpool-hostpath prometheus: podmonitor: diff --git a/cluster/apps/media/audiobookshelf/helm-release.yaml b/cluster/apps/media/audiobookshelf/helm-release.yaml index a8b055c..151a48d 100644 --- a/cluster/apps/media/audiobookshelf/helm-release.yaml +++ b/cluster/apps/media/audiobookshelf/helm-release.yaml @@ -63,7 +63,7 @@ spec: metadata: type: persistentVolumeClaim size: 12Gi - storageClass: openebs-hostpath + storageClass: mainpool-hostpath accessMode: ReadWriteOnce globalMounts: - path: /metadata diff --git a/cluster/apps/monitoring/kube-prometheus-stack/helm-release.yaml b/cluster/apps/monitoring/kube-prometheus-stack/helm-release.yaml index 0844601..9125793 100644 --- a/cluster/apps/monitoring/kube-prometheus-stack/helm-release.yaml +++ b/cluster/apps/monitoring/kube-prometheus-stack/helm-release.yaml @@ -68,7 +68,7 @@ spec: storageSpec: volumeClaimTemplate: spec: - storageClassName: openebs-hostpath + storageClassName: mainpool-hostpath resources: requests: storage: 40Gi diff --git a/cluster/core/storage/openebs/kustomization.yaml b/cluster/core/storage/openebs/kustomization.yaml index dec9b5f..3989888 100644 --- a/cluster/core/storage/openebs/kustomization.yaml +++ b/cluster/core/storage/openebs/kustomization.yaml @@ -4,4 +4,5 @@ resources: - ./namespace.yaml - ./helm-repository.yaml - ./helm-release.yaml +- ./mainpool-sc.yaml - ./monitoring-helm-release.yaml \ No newline at end of file diff --git a/cluster/core/storage/openebs/mainpool-sc.yaml b/cluster/core/storage/openebs/mainpool-sc.yaml new file mode 100644 index 0000000..af9ab35 --- /dev/null +++ b/cluster/core/storage/openebs/mainpool-sc.yaml @@ -0,0 +1,14 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: mainpool-hostpath + annotations: + openebs.io/cas-type: local + cas.openebs.io/config: | + - name: StorageType + value: hostpath + - name: BasePath + value: /mnt/MainPool/Kubernetes/openebs-hostpath +provisioner: openebs.io/local +reclaimPolicy: Retain +volumeBindingMode: WaitForFirstConsumer \ No newline at end of file