The CSI driver enables dynamic provisioning and management of persistent volumes in Kubernetes using STACKIT's block storage services. It follows the CSI specification to ensure compatibility with Kubernetes and other container orchestration systems.
- Dynamic provisioning of persistent volumes
- Volume snapshotting and restoration
- Topology-aware volume placement
- Integration with Kubernetes CSI sidecars
- Volume encryption support
- Volume expansion capabilities
We currently support the following file systems:
- ext3
- ext4 (default)
- xfs
- [EXPERIMENTAL] btrfs. Use at your own risk!
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: premium-perf4-stackit
provisioner: block-storage.csi.stackit.cloud
parameters:
type: "storage_premium_perf4"apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: stackit-block-storageapiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx
volumeMounts:
- mountPath: "/data"
name: my-volume
volumes:
- name: my-volume
persistentVolumeClaim:
claimName: my-pvcThe driver supports topology-aware volume placement. The GetAZFromTopology function extracts the availability zone from topology requirements passed by Kubernetes.
Example topology requirement:
storageClass:
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
- key: topology.block-storage.csi.stackit.cloud/zone
values:
- zone1
- zone2The driver supports volume encryption with the following parameters:
encrypted: Boolean to enable encryptionkmsKeyID: KMS key ID for encryptionkmsKeyringID: KMS keyring IDkmsKeyVersion: KMS key versionkmsServiceAccount: KMS service account
Example StorageClass with encryption:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: encrypted-storage
provisioner: block-storage.csi.stackit.cloud
parameters:
type: "storage_premium_perf4"
encrypted: "true"
kmsKeyID: "your-kms-key-id"
kmsKeyringID: "your-keyring-id"
kmsKeyVersion: "1"
kmsServiceAccount: "your-service-account"This feature enables creating volume snapshots and restoring volumes from snapshots. The corresponding CSI feature (VolumeSnapshotDataSource) has been generally available since Kubernetes v1.20.
To use this feature, deploy the snapshot-controller and CRDs as part of your Kubernetes cluster management process (independent of any CSI Driver). For more information, refer to the Snapshot Controller documentation.
It is also required to create a SnapshotClass for example:
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: stackit
driver: block-storage.csi.stackit.cloud
deletionPolicy: Delete
parameters:
type: "snapshot"-
type: (Optional) Defines the Cinder backend operation to perform. If not specified, it defaults to"snapshot".-
type: "snapshot"(Default) This is a fast, point-in-time copy stored on the same storage backend as the original volume.- Best for: Cloning volumes or fast, short-term rollbacks.
- Warning: This is not a true backup. Failure of the storage backend will result in the loss of both the volume and its snapshots.
-
type: "backup"This creates a full, independent copy of the volume's data in a separate repository.- Best for: True disaster recovery and long-term data protection.
- Note: This operation is slower as it copies all data to a different location.
-
To expand volumes, the StorageClass must allow it:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: expandable-storage
provisioner: block-storage.csi.stackit.cloud
allowVolumeExpansion: trueTo expand a volume, increase the storage request of the PVC:
kubectl patch pvc my-pvc -p '{"spec":{"resources":{"requests":{"storage":"20Gi"}}}}'Volumes can be expanded while they are attached to a running Pod (online) or while they are not in use (offline). The driver resizes the volume first and then the filesystem on the node. For an offline volume, the filesystem is resized when a Pod mounts the volume again. Volumes cannot be shrunk.
The driver reports an expansion as successful only after the volume has the requested size. The STACKIT storage backend can reject a resize after it accepted the request, for example when it has not enough capacity. In this case:
- The PVC keeps its old capacity (
status.capacity). - The PVC gets a
VolumeResizeFailedwarning event with a message likevolume <id> has size 10 GiB after resize, requested 20 GiB. - Kubernetes retries the expansion automatically with an increasing delay. No action is necessary when the backend has capacity again.
Use kubectl describe pvc my-pvc to see the events.