From 6bb7c5a092a5b07c6f5403f29252ea71322bc088 Mon Sep 17 00:00:00 2001 From: Deep Dhanak <16140109+ddhanak@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:51:34 -0400 Subject: [PATCH] feat: try to setup democratic-csi --- .../democratic-csi/democratic-csi/ks.yaml | 16 ++++ .../local-hostpath/helmrelease.yaml | 95 +++++++++++++++++++ .../local-hostpath/kustomization.yaml | 6 ++ .../apps/democratic-csi/kustomization.yaml | 6 ++ kubernetes/apps/democratic-csi/namespace.yaml | 7 ++ .../repositories/helm/democratic-csi.yaml | 9 ++ .../flux/repositories/helm/kustomization.yaml | 1 + 7 files changed, 140 insertions(+) create mode 100644 kubernetes/apps/democratic-csi/democratic-csi/ks.yaml create mode 100644 kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/helmrelease.yaml create mode 100644 kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/kustomization.yaml create mode 100644 kubernetes/apps/democratic-csi/kustomization.yaml create mode 100644 kubernetes/apps/democratic-csi/namespace.yaml create mode 100644 kubernetes/flux/repositories/helm/democratic-csi.yaml diff --git a/kubernetes/apps/democratic-csi/democratic-csi/ks.yaml b/kubernetes/apps/democratic-csi/democratic-csi/ks.yaml new file mode 100644 index 00000000..66bc94f0 --- /dev/null +++ b/kubernetes/apps/democratic-csi/democratic-csi/ks.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: cluster-apps-democratic-csi-local-hostpath + namespace: flux-system +spec: + path: ./kubernetes/apps/democratic-csi/democratic-csi/local-hostpath + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: true + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/helmrelease.yaml b/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/helmrelease.yaml new file mode 100644 index 00000000..d5f636a7 --- /dev/null +++ b/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/helmrelease.yaml @@ -0,0 +1,95 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: democratic-csi + namespace: democratic-csi +spec: + interval: 30m + chart: + spec: + chart: democratic-csi + version: 0.14.2 + sourceRef: + kind: HelmRepository + name: democratic-csi + namespace: flux-system + maxHistory: 2 + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + externalSnapshotter: + enabled: false + csiDriver: + name: "local-freenas-nfs" + driver: + config: + driver: freenas-api-nfs + instance_id: home-kubernetes + httpConnection: + protocol: http + host: 192.168.1.48 + port: 80 + # use only 1 of apiKey or username/password + # if both are present, apiKey is preferred + # apiKey is only available starting in TrueNAS-12 + #apiKey: + username: root + password: + allowInsecure: true + # use apiVersion 2 for TrueNAS-12 and up (will work on 11.x in some scenarios as well) + # leave unset for auto-detection + #apiVersion: 2 + zfs: + # can be used to override defaults if necessary + # the example below is useful for TrueNAS 12 + #cli: + # sudoEnabled: true + # + # leave paths unset for auto-detection + # paths: + # zfs: /usr/local/sbin/zfs + # zpool: /usr/local/sbin/zpool + # sudo: /usr/local/bin/sudo + # chroot: /usr/sbin/chroot + + # can be used to set arbitrary values on the dataset/zvol + # can use handlebars templates with the parameters from the storage class/CO + #datasetProperties: + # "org.freenas:description": "{{ parameters.[csi.storage.k8s.io/pvc/namespace] }}/{{ parameters.[csi.storage.k8s.io/pvc/name] }}" + # "org.freenas:test": "{{ parameters.foo }}" + # "org.freenas:test2": "some value" + + datasetParentName: tank/k8s/vols + # do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap + # they may be siblings, but neither should be nested in the other + # do NOT comment this option out even if you don't plan to use snapshots, just leave it with dummy value + detachedSnapshotsDatasetParentName: tank/k8s/a/snaps + datasetEnableQuotas: true + datasetEnableReservation: false + datasetPermissionsMode: "0777" + datasetPermissionsUser: 0 + datasetPermissionsGroup: 0 + + # not supported yet + #datasetPermissionsAcls: + #- "-m everyone@:full_set:allow" + #- "-m u:kube:full_set:allow" + + nfs: + #shareCommentTemplate: "{{ parameters.[csi.storage.k8s.io/pvc/namespace] }}-{{ parameters.[csi.storage.k8s.io/pvc/name] }}" + shareHost: 192.168.1.48 + shareAlldirs: false + shareAllowedHosts: [] + shareAllowedNetworks: [] + shareMaprootUser: root + shareMaprootGroup: root + shareMapallUser: "" + shareMapallGroup: "" diff --git a/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/kustomization.yaml b/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/kustomization.yaml new file mode 100644 index 00000000..c742a364 --- /dev/null +++ b/kubernetes/apps/democratic-csi/democratic-csi/local-hostpath/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: democratic-csi +resources: + - ./helmrelease.yaml diff --git a/kubernetes/apps/democratic-csi/kustomization.yaml b/kubernetes/apps/democratic-csi/kustomization.yaml new file mode 100644 index 00000000..40b307f6 --- /dev/null +++ b/kubernetes/apps/democratic-csi/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./namespace.yaml + - ./democratic-csi/ks.yaml diff --git a/kubernetes/apps/democratic-csi/namespace.yaml b/kubernetes/apps/democratic-csi/namespace.yaml new file mode 100644 index 00000000..17ee6a42 --- /dev/null +++ b/kubernetes/apps/democratic-csi/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: democratic-csi + labels: + kustomize.toolkit.fluxcd.io/prune: disabled diff --git a/kubernetes/flux/repositories/helm/democratic-csi.yaml b/kubernetes/flux/repositories/helm/democratic-csi.yaml new file mode 100644 index 00000000..4cdc2d8c --- /dev/null +++ b/kubernetes/flux/repositories/helm/democratic-csi.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: democratic-csi + namespace: flux-system +spec: + interval: 2h + url: https://democratic-csi.github.io/charts/ diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/repositories/helm/kustomization.yaml index 64a99c3f..8dc06ccb 100644 --- a/kubernetes/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/flux/repositories/helm/kustomization.yaml @@ -7,6 +7,7 @@ resources: - ./cilium.yaml - ./coredns.yaml - ./csi-driver-nfs.yaml + - ./democratic-csi.yaml - ./external-dns.yaml - ./grafana.yaml - ./hajimari.yaml