LUSCSI is a driver based on the Container Storage Interface (CSI) that enables support for the Lustre file system in Kubernetes clusters. With this driver, users can easily mount Lustre file systems to Kubernetes Pods and achieve dynamic storage volume creation and management.
- Dynamic Volume Creation: Supports dynamic creation of Lustre storage volumes via the CSI interface.
- Parameterized Configuration: Allows users to specify MGS address, file system name, and subdirectory path through parameters.
- Static Data Volumes: Supports mounting specific Lustre directories to Pods, enabling static storage volume creation and management.
- Custom Volume Names: Allows users to define PV names based on the namespace and name of the PVC.
- Volume Quota: Supports setting capacity limits for volumes (requires Lustre 2.16.0 or later).
- Volume Usage Statistics: Supports tracking the usage of storage volumes.
The following parameters are used to configure Lustre volumes:
mgsAddress
: The address of the MGS (Management Service).fsName
: The name of the Lustre file system.sharePath
: The shared storage path where new volumes will be created, defaulting to/csi~volume
(optional).
Note: The sharePath (e.g.,
/csi~volume
) must be pre-created in the Lustre file system.
Ensure the Kubernetes cluster has the Helm plugin installed, and follow these steps to deploy LUSCSI:
# Clone the repository
git clone https://github.com/your-repo/luscsi.git
# Build the image
cd luscsi
REGISTRY=10.6.118.112:5000/luskits make release
# Deploy to the cluster using Helm
helm install luscsi -n luscsi --create-namespace deploy/luscsi/
Define a StorageClass with the required parameters:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: lustre-sc
provisioner: luscsi.luskits.io
parameters:
mgsAddress: "example.mgs.address@o2ib"
fsName: "lustrefs"
sharePath: "/path/to/share" # optional, defaults to /csi~volume
Create a PersistentVolumeClaim (PVC), dynamically allocating a Lustre volume:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: lustre-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: lustre-sc
resources:
requests:
storage: 10Gi
volumeMode: Filesystem
Mount the dynamically created volume to a Pod:
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
containers:
- name: example-container
image: nginx
volumeMounts:
- mountPath: "/mnt/lustre"
name: lustre-volume
volumes:
- name: lustre-volume
persistentVolumeClaim:
claimName: lustre-pvc
Ensure you have the following dependencies installed:
- Go 1.23+
- Docker
- kubectl
Run the following command to install dependencies:
go mod tidy
Enable debug logs:
kubectl logs <driver-pod> -c luscsi
A: Use the following command to check the status of the CSI driver:
kubectl get pods -n kube-system | grep luscsi
A: Check the logs of the driver pod for any error messages:
kubectl logs <driver-pod> -c luscsi