Using block devices in Kubernetes
Edera supports native Kubernetes storage APIs. You can mount block devices directly into pods using standard PersistentVolumes—no special configuration required.
This means you can use local NVMe drives, CSI-managed volumes, or raw host block devices with Edera workloads the same way you would without Edera.
How it works
- Create a PersistentVolume pointing to your block device
- Create a PersistentVolumeClaim to request the storage
- Mount it in your pod with
runtimeClassName: edera
Example: Local NVMe device
This example mounts a local NVMe device (/dev/nvme01) into an Edera-protected workload.
PersistentVolume
kind: PersistentVolume
apiVersion: v1
metadata:
name: local-raw-pv-rw
spec:
volumeMode: Block
capacity:
storage: 5Gi
local:
path: /dev/nvme01
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- my-hostPersistentVolumeClaim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: block-pvc-rw
spec:
accessModes:
- ReadWriteOnce
volumeMode: Block
resources:
requests:
storage: 2GiWorkload
apiVersion: batch/v1
kind: Job
metadata:
name: host-blockdev-rw-pv
spec:
backoffLimit: 0
template:
spec:
runtimeClassName: edera
nodeSelector:
kubernetes.io/hostname: my-host
containers:
- name: test
image: alpine:latest
command: ["/bin/sh", "-c"]
args:
- |
echo "=== Blockdev Test ==="
echo ""
echo "1. Blockdev at /mnt/high-perf-dev:"
if echo "test" > /mnt/high-perf-dev/test && [ -f /mnt/high-perf-dev/test ]; then
echo " SUCCESS: Blockdev writable"
else
echo " FAILURE: Blockdev not present/writable"
exit 1
fi
volumeDevices:
- name: data
devicePath: /mnt/high-perf-dev
volumes:
- name: data
persistentVolumeClaim:
claimName: block-pvc-rw
restartPolicy: NeverThe key elements:
runtimeClassName: edera- Runs the workload in an isolated Edera zonevolumeMode: Block- Uses raw block device accessvolumeDevices- Mounts the block device at the specified path
Additional notes
Native Kubernetes storage APIs (PersistentVolumes and block devices) are supported starting in Edera v1.6.0
Non-Kubernetes use cases
If you’re running Edera outside of Kubernetes, see:
- Claiming devices with Edera - Attach block or PCI devices to standalone zones
- Using a scratch disk with Edera - Configure temporary high-speed storage
Further reading
Last updated on