From 948b96586eedb84253222508c81c50041a4614e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C4=83t=C4=83lin?= Date: Fri, 5 Jan 2024 14:18:45 +0100 Subject: [PATCH] feat(k8s/services/dcsi): add basefiles --- .gitignore | 1 + k8s/argo-apps/democratic-csi.yaml | 21 ++++++++++++++++ k8s/services/dcsi/test.yaml | 35 ++++++++++++++++++++++++++ k8s/services/dcsi/truenas-nfs.yaml | 40 ++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 .gitignore create mode 100644 k8s/argo-apps/democratic-csi.yaml create mode 100644 k8s/services/dcsi/test.yaml create mode 100644 k8s/services/dcsi/truenas-nfs.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/k8s/argo-apps/democratic-csi.yaml b/k8s/argo-apps/democratic-csi.yaml new file mode 100644 index 0000000..4fab8fa --- /dev/null +++ b/k8s/argo-apps/democratic-csi.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: democratic-csi + namespace: argocd +spec: + destination: + name: '' + namespace: 'dcsi' + server: 'https://kubernetes.default.svc' + source: + path: + repoURL: 'https://gitlab.com/fukurokuju/k3s/services.git' + targetRevision: main + sources: [] + project: roboces + syncPolicy: + automated: + prune: false + selfHeal: false + diff --git a/k8s/services/dcsi/test.yaml b/k8s/services/dcsi/test.yaml new file mode 100644 index 0000000..5be14a1 --- /dev/null +++ b/k8s/services/dcsi/test.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx +spec: + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: nfs-pvc +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-pvc +spec: + accessModes: + - ReadWriteOnce + storageClassName: "truenas-nfs-csi" + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/k8s/services/dcsi/truenas-nfs.yaml b/k8s/services/dcsi/truenas-nfs.yaml new file mode 100644 index 0000000..8e6f051 --- /dev/null +++ b/k8s/services/dcsi/truenas-nfs.yaml @@ -0,0 +1,40 @@ +csiDriver: + name: "org.dcsi.nfs" + +storageClasses: +- name: truenas-nfs-csi + defaultClass: false + reclaimPolicy: Delete + volumeBindingMode: Immediate + allowVolumeExpansion: true + parameters: + fsType: nfs + mountOptions: + - noatime + - nfsvers=4.2 +driver: + config: + driver: freenas-api-nfs + instance_id: + httpConnection: + protocol: http + host: 192.168.1.3 + port: 80 + apiKey: "bogus" + allowInsecure: true + zfs: + datasetParentName: pool1/dcsi/a/vols + detachedSnapshotsDatasetParentName: pool1/dcsi/a/snaps + datasetEnableQuotas: true + datasetEnableReservation: false + datasetPermissionsMode: "0777" + datasetPermissionsUser: 0 + datasetPermissionsGroup: 0 + + nfs: + shareHost: 192.168.1.3 + shareAlldirs: false + shareAllowedHosts: [] + shareAllowedNetworks: [] + shareMapallUser: apps + shareMapallGroup: apps \ No newline at end of file