Static Provisioning
Static provisioning lets you mount an existing flexFS volume into Kubernetes pods. This works with both the Enterprise and Community editions.
Prerequisites
Section titled “Prerequisites”- The flexFS CSI driver is installed
- A flexFS volume already exists (created during server installation or via
configure.flexfs) - You have a Secret containing the admin server address and an account token
Create the PersistentVolumeClaim and PersistentVolume
Section titled “Create the PersistentVolumeClaim and PersistentVolume”apiVersion: v1kind: PersistentVolumeClaimmetadata: name: flexfs-static namespace: defaultspec: storageClassName: "" accessModes: - ReadWriteMany resources: requests: storage: 8EiapiVersion: v1kind: PersistentVolumemetadata: name: flexfs-staticspec: storageClassName: "" accessModes: - ReadWriteMany capacity: storage: 8Ei csi: driver: csi.flexfs.io volumeHandle: "<VOLUME-NAME>" nodePublishSecretRef: name: flexfs-secret namespace: default claimRef: name: flexfs-static namespace: defaultReplace <VOLUME-NAME> with the name of your existing flexFS volume.
Key fields
Section titled “Key fields”| Field | Description |
|---|---|
storageClassName: "" | Empty string prevents Kubernetes from using a default StorageClass. |
csi.driver | Must be csi.flexfs.io. |
csi.volumeHandle | The name of the flexFS volume to mount. This is the volume name as shown in configure.flexfs or the free server. |
csi.nodePublishSecretRef | Reference to the Kubernetes Secret containing adminAddr and token. |
claimRef | Pre-binds the PV to the PVC so they pair immediately. |
Create the Secret
Section titled “Create the Secret”The Secret must contain at minimum the adminAddr and token fields:
apiVersion: v1kind: Secretmetadata: name: flexfs-secret namespace: defaultstringData: adminAddr: "<ADMIN-ADDR>" token: "<ACCOUNT-TOKEN>"For encrypted volumes, add the secret field:
stringData: adminAddr: "<ADMIN-ADDR>" token: "<ACCOUNT-TOKEN>" secret: "<ENCRYPTION-SECRET>"See the Secret field reference for all supported fields.
kubectl apply -f secret.yamlkubectl apply -f static-volume.yamlUse in a pod
Section titled “Use in a pod”apiVersion: v1kind: Podmetadata: name: my-appspec: containers: - name: app image: ubuntu:latest command: ["sleep", "infinity"] volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: flexfs-staticRead-only mounting
Section titled “Read-only mounting”To mount the volume as read-only, set readOnly: true on the PV:
spec: csi: driver: csi.flexfs.io volumeHandle: "<VOLUME-NAME>" readOnly: true nodePublishSecretRef: name: flexfs-secret namespace: defaultPassing mount options
Section titled “Passing mount options”You can pass additional mount options via mountOptions on the PV:
spec: csi: driver: csi.flexfs.io volumeHandle: "<VOLUME-NAME>" nodePublishSecretRef: name: flexfs-secret namespace: default mountOptions: - acl - xattr - verboseMultiple volumes on the same node
Section titled “Multiple volumes on the same node”The CSI driver supports up to 10 volumes per node. Each volume gets its own base FUSE mount at /var/lib/kubelet/flexfs/<volume-name>/. Multiple pods referencing the same volume share a single base mount via bind mounts.
Next steps
Section titled “Next steps”- Dynamic provisioning (Enterprise only)
- Configuration reference
- Troubleshooting