rawfile-csi
by yMatrix Inc.
CSI driver for local PV backed by raw image file.
About this chart
rawfile-csi
CSI driver to provision local PVs backed by imaged files in kubernetes cluster.
Usage
On all Kubernetes's nodes, create directories that will be used to provision image files for local PVs.
For example,
$ mkdir -p /mnt/disk_a1 /mnt/disk_b1 /mnt/disk_c1
# (Optional) mount disks to the directories created.
$ mount /dev/sda1 /mnt/disk_a1
$ mount /dev/sdb1 /mnt/disk_b1
$ mount /dev/sdc1 /mnt/disk_c1
Now it is possible to create a StorageClass that will provision image file backed PVs in the directories created.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ymatrix-rawfile
provisioner: rawfile.csi.ymatrix.cn
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
parameters:
dataPaths: "/mnt/disk_a1:/mnt/disk_b1:/mnt/disk_c1"
allocatePolicy: roundrobin
fsType: xfs
allowVolumeExpansion: false # Current release doesn't support expansion yet.
When creating the StorageClass, the following parameters are available.
dataPaths:
Specify the directories in the nodes of the Kubernetes cluster where
image files will be created. The paths should be joined with : as an array.
allocatePolicy:
Decide in which directory an image file will be created to back local PVs.
-
sequential (default)
Create image file in the first directory that has enough free space according to PV's size in
dataPathsarray on one node. -
random
Create image file randomly in directories that have enough free space according to PV's size in
dataPathsarray on one node. -
roundrobin
Create image file in the next directory that has enough free space according to PV's size in
dataPathsarray since last PV image file creation on one node. It will go back to the first directory in thedataPathsarray if it reaches the end of it.
fsType:
File system type to be created on the PV.
- ext4 (default)
- xfs
- btrfs
Deploy rawfile-csi with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rawfile-csi on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartrawfile-csi is pinned at v0.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply