Design

SaunaFS Container Storage Interface

SaunaFS CSI driver implements an interface between a Kubernetes and SaunaFS shares. It enables dynamically provisioning SaunaFS volumes and attaching them as storage to containerized workloads. The driver also allows to mount an existing SaunaFS directory as a static persistent volume.

FeatureSaunaFS CSI
Access modesReadWriteOnce, ReadOnlyMany, ReadWriteMany, ReadWriteOncePod
Volume modesFilesystem, Block
File system typessaunafs (default), ext3, ext4, xfs
Dynamic ProvisioningYes
Volume Snapshot and Restore supportYes
Volume CloningYes
Volume ExpansionYes
Mount corruption detection and recoverYes

CSI Controller and Node service

SaunaFS CSI has implemented both CSI Node serviceopen in new window and CSI controller serviceopen in new window. To mount and manage volumes, the Node service uses Mounter Manager, which deploys on each node a Mounter Pod with built-in SaunaFS client. Pods are deployed on a certain node only if there is any volume that will be mounted on that node. Pod is deleted when the last volume on this node is deleted.

SaunaFS client update

SaunaFS CSI supports update of SaunaFS clientopen in new window. After the upgrade, mounter manager doesn't force a re-deployment of every pod that uses a volume mounted by the old client. The manager just deploys mounter pods with a newer version of SaunaFS client to handle the newly created volumes. If all volumes mounted by the old client are unmounted, then the former mounter pods will be deleted.

Thanks to this solution, the cluster isn't paralyzed when a newer version is released, and pods can be redeployed at the best time for this.

SaunaFS out of Kubernetes

It's possible to expose for containerized workloads SaunaFS share that's out of the Kubernetes cluster. It just requires the external hostname of the SaunaFS master in the connection info secret (stringData.masterAddress).

kind: Secret
apiVersion: v1
metadata:
  name: saunafs-secret
  namespace: saunafs-csi
type: Opaque
stringData:
  masterAddress: 10.20.45.18
  masterPort: 9421
  rootDir: /
data:
  password: S4unaF5#85&32

Mount corruption detection and recover

SaunaFS mount might get corrupted due to SaunaFS mounter error. It's a rare occurrence, but if it happens SaunaFS CSI will detect mount corruption on next volume publish request and will perform recovery by remounting corrupted mount. Mount will be recovered for newly scheduled pods.

However pods that are already using broken mount point will remain broken until restart. Proper handling of this situation is required from application using the share and in case of volume unavailability (application can't read the mounted dir) pod should be scheduled for restart.