blob: 35c6e72003d6f5ffaa047df2b10901c80e6234cd [file] [log] [blame]
Mohammed Naserb8eccd22023-02-10 05:55:56 +00001{{- $root := . -}}
2{{- range $filesystem := .Values.cephFileSystems -}}
3---
4apiVersion: ceph.rook.io/v1
Mohammed Naser65cda132024-05-02 14:34:08 -04005kind: CephFilesystemSubVolumeGroup
6metadata:
7 name: {{ $filesystem.name }}-csi # lets keep the svg crd name same as `filesystem name + csi` for the default csi svg
8 namespace: {{ $root.Release.Namespace }} # namespace:cluster
9spec:
10 # The name of the subvolume group. If not set, the default is the name of the subvolumeGroup CR.
11 name: csi
12 # filesystemName is the metadata name of the CephFilesystem CR where the subvolume group will be created
13 filesystemName: {{ $filesystem.name }}
14 # reference https://docs.ceph.com/en/latest/cephfs/fs-volumes/#pinning-subvolumes-and-subvolume-groups
15 # only one out of (export, distributed, random) can be set at a time
16 # by default pinning is set with value: distributed=1
17 # for disabling default values set (distributed=0)
18 pinning:
19 distributed: 1 # distributed=<0, 1> (disabled=0)
20 # export: # export=<0-256> (disabled=-1)
21 # random: # random=[0.0, 1.0](disabled=0.0)
22---
23apiVersion: ceph.rook.io/v1
Mohammed Naserb8eccd22023-02-10 05:55:56 +000024kind: CephFilesystem
25metadata:
26 name: {{ $filesystem.name }}
Mohammed Naser65cda132024-05-02 14:34:08 -040027 namespace: {{ $root.Release.Namespace }} # namespace:cluster
Mohammed Naserb8eccd22023-02-10 05:55:56 +000028spec:
29{{ toYaml $filesystem.spec | indent 2 }}
30---
31{{- if default false $filesystem.storageClass.enabled }}
32apiVersion: storage.k8s.io/v1
33kind: StorageClass
34metadata:
35 name: {{ $filesystem.storageClass.name }}
36 annotations:
37 storageclass.kubernetes.io/is-default-class: "{{ if default false $filesystem.storageClass.isDefault }}true{{ else }}false{{ end }}"
Mohammed Naser65cda132024-05-02 14:34:08 -040038{{- if $root.Values.csiDriverNamePrefix }}
39provisioner: {{ $root.Values.csiDriverNamePrefix }}.cephfs.csi.ceph.com
40{{- else }}
Mohammed Naserb8eccd22023-02-10 05:55:56 +000041provisioner: {{ $root.Values.operatorNamespace }}.cephfs.csi.ceph.com
Mohammed Naser65cda132024-05-02 14:34:08 -040042{{- end }}
Mohammed Naserb8eccd22023-02-10 05:55:56 +000043parameters:
44 fsName: {{ $filesystem.name }}
45 pool: {{ $filesystem.name }}-{{ default "data0" $filesystem.storageClass.pool }}
46 clusterID: {{ $root.Release.Namespace }}
47{{ with $filesystem.storageClass.parameters }}
48{{ tpl (toYaml .) $ | indent 2 }}
49{{ end }}
50reclaimPolicy: {{ default "Delete" $filesystem.storageClass.reclaimPolicy }}
51allowVolumeExpansion: {{ default "true" $filesystem.storageClass.allowVolumeExpansion }}
Mohammed Naser65cda132024-05-02 14:34:08 -040052volumeBindingMode: {{ default "Immediate" $filesystem.storageClass.volumeBindingMode }}
Mohammed Naserb8eccd22023-02-10 05:55:56 +000053{{- if $filesystem.storageClass.mountOptions }}
54mountOptions:
55 {{- range $filesystem.storageClass.mountOptions }}
56 - {{ . }}
57 {{- end }}
58{{- end }}
59{{ end }}
60{{ end }}