diff --git a/kubernetes/apps/storage/kustomization.yaml b/kubernetes/apps/storage/kustomization.yaml new file mode 100644 index 00000000..3e7f3f59 --- /dev/null +++ b/kubernetes/apps/storage/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 + - ./local-path-provisioner/ks.yaml diff --git a/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml b/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml new file mode 100644 index 00000000..b9f00ada --- /dev/null +++ b/kubernetes/apps/storage/local-path-provisioner/app/helmrelease.yaml @@ -0,0 +1,77 @@ +--- +# 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:v3.6.3 + 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 /mnt/localpath + 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/local-path-provisioner/app/kustomization.yaml b/kubernetes/apps/storage/local-path-provisioner/app/kustomization.yaml new file mode 100644 index 00000000..17cbc72b --- /dev/null +++ b/kubernetes/apps/storage/local-path-provisioner/app/kustomization.yaml @@ -0,0 +1,6 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml diff --git a/kubernetes/apps/storage/local-path-provisioner/ks.yaml b/kubernetes/apps/storage/local-path-provisioner/ks.yaml new file mode 100644 index 00000000..fa12d36f --- /dev/null +++ b/kubernetes/apps/storage/local-path-provisioner/ks.yaml @@ -0,0 +1,21 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app local-path-provisioner + namespace: flux-system +spec: + targetNamespace: storage + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/storage/local-path-provisioner/app + prune: true + sourceRef: + kind: GitRepository + name: homelab + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/apps/storage/namespace.yaml b/kubernetes/apps/storage/namespace.yaml new file mode 100644 index 00000000..a8966521 --- /dev/null +++ b/kubernetes/apps/storage/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: storage + labels: + kustomize.toolkit.fluxcd.io/prune: disabled