From d51302bf18923d3b2233a9120c10ba7179bfd37a Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Thu, 15 Feb 2024 16:50:33 -0600 Subject: [PATCH] Added openebs local storage, removed local-path provisioner, changed storage ns to volsync-system. --- .../apps/openebs-system/kustomization.yaml | 9 +++ kubernetes/apps/openebs-system/namespace.yaml | 8 ++ .../openebs/app/helmrelease.yaml | 32 ++++++++ .../openebs}/app/kustomization.yaml | 2 +- .../openebs}/ks.yaml | 10 +-- .../app/helmrelease.yaml | 77 ------------------- .../kustomization.yaml | 1 - .../namespace.yaml | 2 +- .../snapshot-controller/app/helmrelease.yaml | 0 .../snapshot-controller/ks.yaml | 2 +- .../volsync/app/helmrelease.yaml | 0 .../volsync/app/kustomization.yaml | 0 .../volsync/ks.yaml | 2 +- .../flux/repositories/helm/kustomization.yaml | 1 + .../flux/repositories/helm/openebs.yaml | 10 +++ 15 files changed, 69 insertions(+), 87 deletions(-) create mode 100644 kubernetes/apps/openebs-system/kustomization.yaml create mode 100644 kubernetes/apps/openebs-system/namespace.yaml create mode 100644 kubernetes/apps/openebs-system/openebs/app/helmrelease.yaml rename kubernetes/apps/{storage/local-path-provisioner => openebs-system/openebs}/app/kustomization.yaml (87%) rename kubernetes/apps/{storage/local-path-provisioner => openebs-system/openebs}/ks.yaml (51%) delete mode 100644 kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml rename kubernetes/apps/{storage => volsync-system}/kustomization.yaml (88%) rename kubernetes/apps/{storage => volsync-system}/namespace.yaml (81%) rename kubernetes/apps/{storage => volsync-system}/snapshot-controller/app/helmrelease.yaml (100%) rename kubernetes/apps/{storage => volsync-system}/snapshot-controller/ks.yaml (87%) rename kubernetes/apps/{storage => volsync-system}/volsync/app/helmrelease.yaml (100%) rename kubernetes/apps/{storage => volsync-system}/volsync/app/kustomization.yaml (100%) rename kubernetes/apps/{storage => volsync-system}/volsync/ks.yaml (90%) create mode 100644 kubernetes/flux/repositories/helm/openebs.yaml diff --git a/kubernetes/apps/openebs-system/kustomization.yaml b/kubernetes/apps/openebs-system/kustomization.yaml new file mode 100644 index 00000000..334dd681 --- /dev/null +++ b/kubernetes/apps/openebs-system/kustomization.yaml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + # Pre Flux-Kustomizations + - ./namespace.yaml + # Flux-Kustomizations + - ./openebs/ks.yaml \ No newline at end of file diff --git a/kubernetes/apps/openebs-system/namespace.yaml b/kubernetes/apps/openebs-system/namespace.yaml new file mode 100644 index 00000000..f79a5197 --- /dev/null +++ b/kubernetes/apps/openebs-system/namespace.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: openebs-system + annotations: + kustomize.toolkit.fluxcd.io/prune: disabled + volsync.backube/privileged-movers: "true" \ No newline at end of file diff --git a/kubernetes/apps/openebs-system/openebs/app/helmrelease.yaml b/kubernetes/apps/openebs-system/openebs/app/helmrelease.yaml new file mode 100644 index 00000000..5a5e25cd --- /dev/null +++ b/kubernetes/apps/openebs-system/openebs/app/helmrelease.yaml @@ -0,0 +1,32 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: openebs +spec: + interval: 30m + chart: + spec: + chart: openebs + version: 3.10.0 + sourceRef: + kind: HelmRepository + name: openebs + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + localprovisioner: + hostpathClass: + enabled: true + name: openebs-hostpath + isDefaultClass: false + basePath: /var/openebs/local \ No newline at end of file diff --git a/kubernetes/apps/storage/local-path-provisioner/app/kustomization.yaml b/kubernetes/apps/openebs-system/openebs/app/kustomization.yaml similarity index 87% rename from kubernetes/apps/storage/local-path-provisioner/app/kustomization.yaml rename to kubernetes/apps/openebs-system/openebs/app/kustomization.yaml index 17cbc72b..2d7deaca 100644 --- a/kubernetes/apps/storage/local-path-provisioner/app/kustomization.yaml +++ b/kubernetes/apps/openebs-system/openebs/app/kustomization.yaml @@ -3,4 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ./helmrelease.yaml + - ./helmrelease.yaml \ No newline at end of file diff --git a/kubernetes/apps/storage/local-path-provisioner/ks.yaml b/kubernetes/apps/openebs-system/openebs/ks.yaml similarity index 51% rename from kubernetes/apps/storage/local-path-provisioner/ks.yaml rename to kubernetes/apps/openebs-system/openebs/ks.yaml index fa12d36f..4bff98f1 100644 --- a/kubernetes/apps/storage/local-path-provisioner/ks.yaml +++ b/kubernetes/apps/openebs-system/openebs/ks.yaml @@ -1,16 +1,16 @@ --- -# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: &app local-path-provisioner + name: &app openebs namespace: flux-system spec: - targetNamespace: storage + targetNamespace: openebs-system commonMetadata: labels: app.kubernetes.io/name: *app - path: ./kubernetes/apps/storage/local-path-provisioner/app + path: ./kubernetes/apps/openebs-system/openebs/app prune: true sourceRef: kind: GitRepository @@ -18,4 +18,4 @@ spec: wait: false interval: 30m retryInterval: 1m - timeout: 5m + timeout: 5m \ No newline at end of file diff --git a/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml b/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml deleted file mode 100644 index 2de77c71..00000000 --- a/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml +++ /dev/null @@ -1,77 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: local-path-provisioner -spec: - interval: 30m - chart: - spec: - chart: democratic-csi - version: 0.14.5 - sourceRef: - name: democratic-csi - kind: HelmRepository - namespace: flux-system - install: - remediation: - retries: 3 - upgrade: - cleanupOnFail: true - remediation: - retries: 3 - uninstall: - keepHistory: false - values: - fullnameOverride: local-path-provisioner - controller: - strategy: node - externalProvisioner: - image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.0 - extraArgs: - - --leader-election=false - - --node-deployment=true - - --node-deployment-immediate-binding=false - - --feature-gates=Topology=true - - --strict-topology=true - - --enable-capacity=true - - --capacity-ownerref-level=1 - externalResizer: - enabled: false - externalAttacher: - enabled: false - externalSnapshotter: - enabled: false - csiDriver: - name: local-hostpath.cluster.local - storageCapacity: true - attachRequired: false - fsGroupPolicy: File - storageClasses: - - name: local-hostpath - defaultClass: false - reclaimPolicy: Delete - volumeBindingMode: WaitForFirstConsumer - allowVolumeExpansion: true - driver: - config: - driver: local-hostpath - local-hostpath: - shareBasePath: &storagePath /var/lib/rancher/k3s/local-hostpath - controllerBasePath: *storagePath - dirPermissionsMode: "0770" - dirPermissionsUser: 0 - dirPermissionsGroup: 0 - node: - driver: - image: ghcr.io/democratic-csi/democratic-csi:v1.8.4 - extraVolumeMounts: - - name: local-hostpath - mountPath: *storagePath - mountPropagation: Bidirectional - extraVolumes: - - name: local-hostpath - hostPath: - path: *storagePath - type: DirectoryOrCreate diff --git a/kubernetes/apps/storage/kustomization.yaml b/kubernetes/apps/volsync-system/kustomization.yaml similarity index 88% rename from kubernetes/apps/storage/kustomization.yaml rename to kubernetes/apps/volsync-system/kustomization.yaml index d3585c1c..5b5a44ea 100644 --- a/kubernetes/apps/storage/kustomization.yaml +++ b/kubernetes/apps/volsync-system/kustomization.yaml @@ -6,6 +6,5 @@ resources: # Pre Flux-Kustomizations - ./namespace.yaml # Flux-Kustomizations - - ./local-path-provisioner/ks.yaml - ./snapshot-controller/ks.yaml - ./volsync/ks.yaml diff --git a/kubernetes/apps/storage/namespace.yaml b/kubernetes/apps/volsync-system/namespace.yaml similarity index 81% rename from kubernetes/apps/storage/namespace.yaml rename to kubernetes/apps/volsync-system/namespace.yaml index a8966521..10f3c084 100644 --- a/kubernetes/apps/storage/namespace.yaml +++ b/kubernetes/apps/volsync-system/namespace.yaml @@ -2,6 +2,6 @@ apiVersion: v1 kind: Namespace metadata: - name: storage + name: volsync-system labels: kustomize.toolkit.fluxcd.io/prune: disabled diff --git a/kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml b/kubernetes/apps/volsync-system/snapshot-controller/app/helmrelease.yaml similarity index 100% rename from kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml rename to kubernetes/apps/volsync-system/snapshot-controller/app/helmrelease.yaml diff --git a/kubernetes/apps/storage/snapshot-controller/ks.yaml b/kubernetes/apps/volsync-system/snapshot-controller/ks.yaml similarity index 87% rename from kubernetes/apps/storage/snapshot-controller/ks.yaml rename to kubernetes/apps/volsync-system/snapshot-controller/ks.yaml index 1f8d59c9..001c6e5d 100644 --- a/kubernetes/apps/storage/snapshot-controller/ks.yaml +++ b/kubernetes/apps/volsync-system/snapshot-controller/ks.yaml @@ -10,7 +10,7 @@ spec: commonMetadata: labels: app.kubernetes.io/name: *app - path: ./kubernetes/apps/storage/snapshot-controller/app + path: ./kubernetes/apps/volsync-system/snapshot-controller/app prune: true sourceRef: kind: GitRepository diff --git a/kubernetes/apps/storage/volsync/app/helmrelease.yaml b/kubernetes/apps/volsync-system/volsync/app/helmrelease.yaml similarity index 100% rename from kubernetes/apps/storage/volsync/app/helmrelease.yaml rename to kubernetes/apps/volsync-system/volsync/app/helmrelease.yaml diff --git a/kubernetes/apps/storage/volsync/app/kustomization.yaml b/kubernetes/apps/volsync-system/volsync/app/kustomization.yaml similarity index 100% rename from kubernetes/apps/storage/volsync/app/kustomization.yaml rename to kubernetes/apps/volsync-system/volsync/app/kustomization.yaml diff --git a/kubernetes/apps/storage/volsync/ks.yaml b/kubernetes/apps/volsync-system/volsync/ks.yaml similarity index 90% rename from kubernetes/apps/storage/volsync/ks.yaml rename to kubernetes/apps/volsync-system/volsync/ks.yaml index 1c834eb1..8a39bfb1 100644 --- a/kubernetes/apps/storage/volsync/ks.yaml +++ b/kubernetes/apps/volsync-system/volsync/ks.yaml @@ -11,7 +11,7 @@ spec: labels: app.kubernetes.io/name: *appname interval: 10m - path: "./kubernetes/apps/storage/volsync/app" + path: "./kubernetes/apps/volsync-system/volsync/app" prune: true sourceRef: kind: GitRepository diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/repositories/helm/kustomization.yaml index b5b5ce3a..3b599514 100644 --- a/kubernetes/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/flux/repositories/helm/kustomization.yaml @@ -28,6 +28,7 @@ resources: - kubernetes-sigs-metrics-server.yaml - kubernetes-sigs-external-dns.yaml - nvidia.yaml + - openebs.yaml - piraeus.yaml - postfinance.yaml - prometheus-community.yaml diff --git a/kubernetes/flux/repositories/helm/openebs.yaml b/kubernetes/flux/repositories/helm/openebs.yaml new file mode 100644 index 00000000..2b6b9a6f --- /dev/null +++ b/kubernetes/flux/repositories/helm/openebs.yaml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/source.toolkit.fluxcd.io/helmrepository_v1beta2.json +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: openebs + namespace: flux-system +spec: + interval: 2h + url: https://openebs.github.io/charts \ No newline at end of file