From ad8e7853a6dec220cc37601993c8b7dfcce6dff3 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 13 Sep 2024 22:38:01 -0400 Subject: [PATCH] feat: add snapshot-system and openebs mayastor --- kubernetes/thin/apps/kustomization.yaml | 3 +- .../thin/apps/openebs/app/helm-release.yaml | 70 +++++++++++++++++++ .../apps/openebs/app/helm-repository.yaml | 17 +++++ .../thin/apps/openebs/app/kustomization.yaml | 7 ++ .../openebs/app/monitoring-helm-release.yaml | 41 +++++++++++ .../thin/apps/openebs/app/namespace.yaml | 4 ++ kubernetes/thin/apps/openebs/ks.yaml | 59 ++++++++++++++++ .../storage-class/dual-replica-sc.yaml | 8 +++ .../openebs/storage-class/kustomization.yaml | 5 ++ .../thin/apps/openebs/storage-class/pool.yaml | 39 +++++++++++ .../snapshot-system/app/helm-release.yaml | 31 ++++++++ .../apps/snapshot-system/app/helm-repo.yaml | 8 +++ .../snapshot-system/app/kustomization.yaml | 6 ++ .../apps/snapshot-system/app/namespace.yaml | 4 ++ kubernetes/thin/apps/snapshot-system/ks.yaml | 18 +++++ 15 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 kubernetes/thin/apps/openebs/app/helm-release.yaml create mode 100644 kubernetes/thin/apps/openebs/app/helm-repository.yaml create mode 100644 kubernetes/thin/apps/openebs/app/kustomization.yaml create mode 100644 kubernetes/thin/apps/openebs/app/monitoring-helm-release.yaml create mode 100644 kubernetes/thin/apps/openebs/app/namespace.yaml create mode 100644 kubernetes/thin/apps/openebs/ks.yaml create mode 100644 kubernetes/thin/apps/openebs/storage-class/dual-replica-sc.yaml create mode 100644 kubernetes/thin/apps/openebs/storage-class/kustomization.yaml create mode 100644 kubernetes/thin/apps/openebs/storage-class/pool.yaml create mode 100644 kubernetes/thin/apps/snapshot-system/app/helm-release.yaml create mode 100644 kubernetes/thin/apps/snapshot-system/app/helm-repo.yaml create mode 100644 kubernetes/thin/apps/snapshot-system/app/kustomization.yaml create mode 100644 kubernetes/thin/apps/snapshot-system/app/namespace.yaml create mode 100644 kubernetes/thin/apps/snapshot-system/ks.yaml diff --git a/kubernetes/thin/apps/kustomization.yaml b/kubernetes/thin/apps/kustomization.yaml index faa4846..35ba11f 100644 --- a/kubernetes/thin/apps/kustomization.yaml +++ b/kubernetes/thin/apps/kustomization.yaml @@ -7,7 +7,8 @@ resources: - ./traefik - ../../common/apps/cert-manager # storage -#- ../../common/apps/openebs +- ./snapshot-system/ks.yaml +- ./openebs/ks.yaml # hardware - ../../common/apps/nfd/ks.yaml - ../../common/apps/intel-gpu/ks.yaml diff --git a/kubernetes/thin/apps/openebs/app/helm-release.yaml b/kubernetes/thin/apps/openebs/app/helm-release.yaml new file mode 100644 index 0000000..e0a9877 --- /dev/null +++ b/kubernetes/thin/apps/openebs/app/helm-release.yaml @@ -0,0 +1,70 @@ +# 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 +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 + + # 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 + localpv: + enabled: true + hostpathClass: + enabled: true + + # Refer to https://github.com/openebs/mayastor-extensions/blob/v2.7.0/chart/values.yaml for complete set of values. + mayastor: + enabled: true + nodeSelector: + kubernetes.io/arch: amd64 + openebs.io/engine: mayastor + csi: + node: + initContainers: + enabled: true + etcd: + # -- Kubernetes Cluster Domain + clusterDomain: cluster.local + crds: + enabled: false + monitoring: + enabled: false + loki-stack: + enabled: false + storageClass: + nameSuffix: single + tolerations: + # tolerate control plane + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" + + engines: + local: + lvm: + enabled: true + zfs: + enabled: true + replicated: + mayastor: + enabled: true + diff --git a/kubernetes/thin/apps/openebs/app/helm-repository.yaml b/kubernetes/thin/apps/openebs/app/helm-repository.yaml new file mode 100644 index 0000000..2bec563 --- /dev/null +++ b/kubernetes/thin/apps/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-charts + namespace: flux-system +spec: + interval: 1m + url: https://openebs.github.io/monitoring \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/app/kustomization.yaml b/kubernetes/thin/apps/openebs/app/kustomization.yaml new file mode 100644 index 0000000..4ee545a --- /dev/null +++ b/kubernetes/thin/apps/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/thin/apps/openebs/app/monitoring-helm-release.yaml b/kubernetes/thin/apps/openebs/app/monitoring-helm-release.yaml new file mode 100644 index 0000000..d8cb0cd --- /dev/null +++ b/kubernetes/thin/apps/openebs/app/monitoring-helm-release.yaml @@ -0,0 +1,41 @@ +# 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-monitoring + namespace: openebs +spec: + interval: 5m + chart: + spec: + chart: openebs-monitoring + version: 0.4.13 + sourceRef: + kind: HelmRepository + name: openebs-monitoring-charts + namespace: flux-system + dependsOn: + - name: openebs + 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: false \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/app/namespace.yaml b/kubernetes/thin/apps/openebs/app/namespace.yaml new file mode 100644 index 0000000..2175285 --- /dev/null +++ b/kubernetes/thin/apps/openebs/app/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: openebs \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/ks.yaml b/kubernetes/thin/apps/openebs/ks.yaml new file mode 100644 index 0000000..682a73c --- /dev/null +++ b/kubernetes/thin/apps/openebs/ks.yaml @@ -0,0 +1,59 @@ + +--- +# 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: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/openebs/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: snapshot-controller + namespace: flux-system + 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/thin/apps/openebs/storage-class + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs + namespace: flux-system + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/storage-class/dual-replica-sc.yaml b/kubernetes/thin/apps/openebs/storage-class/dual-replica-sc.yaml new file mode 100644 index 0000000..62dea56 --- /dev/null +++ b/kubernetes/thin/apps/openebs/storage-class/dual-replica-sc.yaml @@ -0,0 +1,8 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-dual +parameters: + protocol: nvmf + repl: "2" +provisioner: io.openebs.csi-mayastor \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/storage-class/kustomization.yaml b/kubernetes/thin/apps/openebs/storage-class/kustomization.yaml new file mode 100644 index 0000000..20cd2b1 --- /dev/null +++ b/kubernetes/thin/apps/openebs/storage-class/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./pool.yaml +- ./dual-replica-sc.yaml \ No newline at end of file diff --git a/kubernetes/thin/apps/openebs/storage-class/pool.yaml b/kubernetes/thin/apps/openebs/storage-class/pool.yaml new file mode 100644 index 0000000..49e25e5 --- /dev/null +++ b/kubernetes/thin/apps/openebs/storage-class/pool.yaml @@ -0,0 +1,39 @@ +apiVersion: "openebs.io/v1beta2" +kind: DiskPool +metadata: + name: pool-dorm-controller-d52ycbgv + namespace: openebs +spec: + node: dorm-controller-d52ycbgv + disks: + - /dev/disk/by-id/nvme-SAMSUNG_MZVLB256HAHQ-000H1_S425NX1MA23444 +--- +apiVersion: "openebs.io/v1beta2" +kind: DiskPool +metadata: + name: pool-dorm-worker-3ssgwrlx + namespace: openebs +spec: + node: dorm-worker-3ssgwrlx + disks: + - /dev/disk/by-id/nvme-KXG60ZNV256G_TOSHIBA_69CA70CIK34N +--- +apiVersion: "openebs.io/v1beta2" +kind: DiskPool +metadata: + name: pool-dorm-worker-hklqhcrv + namespace: openebs +spec: + node: dorm-worker-hklqhcrv + disks: + - /dev/disk/by-id/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX0K125956 +--- +apiVersion: "openebs.io/v1beta2" +kind: DiskPool +metadata: + name: pool-dorm-worker-kgoutccb + namespace: openebs +spec: + node: dorm-worker-kgoutccb + disks: + - /dev/disk/by-id/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX0K173346 \ No newline at end of file diff --git a/kubernetes/thin/apps/snapshot-system/app/helm-release.yaml b/kubernetes/thin/apps/snapshot-system/app/helm-release.yaml new file mode 100644 index 0000000..6eb28ff --- /dev/null +++ b/kubernetes/thin/apps/snapshot-system/app/helm-release.yaml @@ -0,0 +1,31 @@ +# 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: snapshot-controller + namespace: snapshot-system +spec: + interval: 30m + timeout: 15m + chart: + spec: + chart: snapshot-controller + version: 3.0.6 + sourceRef: + kind: HelmRepository + name: piraeus + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + controller: + serviceMonitor: + create: false # TODO + webhook: + enabled: false \ No newline at end of file diff --git a/kubernetes/thin/apps/snapshot-system/app/helm-repo.yaml b/kubernetes/thin/apps/snapshot-system/app/helm-repo.yaml new file mode 100644 index 0000000..91c9108 --- /dev/null +++ b/kubernetes/thin/apps/snapshot-system/app/helm-repo.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: piraeus + namespace: flux-system +spec: + interval: 1m + url: https://piraeus.io/helm-charts/ \ No newline at end of file diff --git a/kubernetes/thin/apps/snapshot-system/app/kustomization.yaml b/kubernetes/thin/apps/snapshot-system/app/kustomization.yaml new file mode 100644 index 0000000..524ef3c --- /dev/null +++ b/kubernetes/thin/apps/snapshot-system/app/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./namespace.yaml +- ./helm-repo.yaml +- ./helm-release.yaml \ No newline at end of file diff --git a/kubernetes/thin/apps/snapshot-system/app/namespace.yaml b/kubernetes/thin/apps/snapshot-system/app/namespace.yaml new file mode 100644 index 0000000..1409af9 --- /dev/null +++ b/kubernetes/thin/apps/snapshot-system/app/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: snapshot-system \ No newline at end of file diff --git a/kubernetes/thin/apps/snapshot-system/ks.yaml b/kubernetes/thin/apps/snapshot-system/ks.yaml new file mode 100644 index 0000000..50acd91 --- /dev/null +++ b/kubernetes/thin/apps/snapshot-system/ks.yaml @@ -0,0 +1,18 @@ +# 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: snapshot-controller + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./kubernetes/thin/apps/snapshot-controller/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg \ No newline at end of file