Skip to main content

Longhorn backend (first integration slice)

Atlas can discover Longhorn v1beta2 nodes and volumes through the Kubernetes API. Enable it with ATLAS_LONGHORN_ENABLE=1 and, if needed, ATLAS_LONGHORN_NAMESPACE=longhorn-system. Configure the gateway service account with read access to those CRDs; the included deploy/k8s/atlas-gateway.yaml role contains the permission. The gateway fails startup if the Kubernetes client cannot initialize. Run POST /api/atlas/v1/backends/bkd_longhorn/discover after Longhorn is installed. Failed CRD reads fail discovery; no demo data is substituted.

The backend shows physical node-disk capacity, volume sizes, PVC identity and Longhorn robustness. Unknown disk capacity is reported as unknown. Its one synthetic longhorn pool aggregates disks; it does not represent a Longhorn replica placement or disk pool. Ceph OSD, CephFS and RGW operations do not apply. The native driver is read-only.

Atlas can create a Longhorn PVC using its existing Kubernetes job path. Supply both the Atlas backend ID and a StorageClass whose provisioner is driver.longhorn.io:

{
"tenant_id": "your-tenant-id",
"name": "app-data",
"size_bytes": 10737418240,
"kind": "block",
"kubernetes": {
"backend_id": "bkd_longhorn",
"namespace": "default",
"storage_class": "longhorn"
}
}

Send this to POST /api/atlas/v1/volumes with the usual Atlas authorization. An explicit Longhorn StorageClass is required: the default policy catalog still resolves to Ceph classes. Atlas checks the actual StorageClass provisioner and the backend's cordon state before queuing. Snapshot/clone, Longhorn backup, replica placement, and native volume mutations are not implemented by this driver. Validate RWX migration on your chosen Longhorn storage mode before using it for KubeVirt live migration.