Skip to content

Commit

Permalink
feat: try to setup democratic-csi
Browse files Browse the repository at this point in the history
  • Loading branch information
ddhanak committed Oct 29, 2023
1 parent e5c4e89 commit 6bb7c5a
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kubernetes/apps/democratic-csi/democratic-csi/ks.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: democratic-csi
resources:
- ./helmrelease.yaml
6 changes: 6 additions & 0 deletions kubernetes/apps/democratic-csi/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
- ./democratic-csi/ks.yaml
7 changes: 7 additions & 0 deletions kubernetes/apps/democratic-csi/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: democratic-csi
labels:
kustomize.toolkit.fluxcd.io/prune: disabled
9 changes: 9 additions & 0 deletions kubernetes/flux/repositories/helm/democratic-csi.yaml
Original file line number Diff line number Diff line change
@@ -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/
1 change: 1 addition & 0 deletions kubernetes/flux/repositories/helm/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ./cilium.yaml
- ./coredns.yaml
- ./csi-driver-nfs.yaml
- ./democratic-csi.yaml
- ./external-dns.yaml
- ./grafana.yaml
- ./hajimari.yaml
Expand Down

0 comments on commit 6bb7c5a

Please sign in to comment.