Provision with LocalVolume
A LocalVolume statically provisions one PersistentVolume per listed device path. The operator also creates the StorageClass named in spec.storageClassDevices[].storageClassName if it does not exist.
Use LocalVolume when you know the exact disks. For filter-based provisioning, see Provision with LocalVolumeSet.
TOC
PrerequisitesProvision Filesystem volumesProvision Block volumesBind a PersistentVolumeClaimAdd disks or nodesPrerequisites
- Alauda Container Platform Local Disk Provisioner is installed. See Install.
- Each target device is attached to a node, is not mounted, and has no partitions.
- Prefer stable paths from Discover local disks, such as
/dev/disk/by-id/.... Do not use a short/dev/sdXname or a/dev/disk/by-path/...path. Those names can change after a node reboot.
Provision Filesystem volumes
Local volumes are static. The provisioner looks for devices at the paths you list.
Do not use different StorageClass names for the same device. That creates multiple PersistentVolumes for one disk.
On a control plane node:
- Namespace where Alauda Container Platform Local Disk Provisioner is installed. The default is
acp-storage. - Optional. Nodes that have the listed disks. Get hostnames from
kubectl get node. If omitted, the operator looks for the paths on every node. - StorageClass for the PersistentVolumes. The operator creates it if it does not exist. Use a name that uniquely identifies this set of disks.
- When
true, the operator wipes partition tables, filesystem signatures, and data on the listed devices before use. The default isfalse. Settrueonly when the devices can be destroyed. FilesystemorBlock.- Filesystem created on first mount. Set this only when
volumeModeisFilesystem. - Device paths. Use
/dev/disk/by-id/...fromLocalVolumeDiscoveryResult.status.discoveredDevices[].deviceID. Do not use/dev/sdXor/dev/disk/by-path/....
forceWipeDevicesAndDestroyAllData: true destroys existing data on the listed devices.
Verify PersistentVolumes:
Example output:
Editing a LocalVolume does not change fsType or volumeMode on PersistentVolumes that already exist. That change would be destructive.
Provision Block volumes
To provision raw block devices, set volumeMode: Block and omit fsType:
Use a StorageClass name that identifies this Block set, for example localblock. The PersistentVolumeClaim must also set volumeMode: Block.
Bind a PersistentVolumeClaim
Create the claim in the project that will use the volume. The request must not exceed the device capacity.
Filesystem claim:
- Must match the
LocalVolumevolumeMode. UseBlockfor Block volumes. - Must be less than or equal to the PersistentVolume capacity.
- Must match
spec.storageClassDevices[].storageClassName.
Confirm the claim is bound:
Add disks or nodes
Adding a disk or a node is an edit of the same LocalVolume. It is not a separate procedure.
- Add a disk: append a
/dev/disk/by-id/...path tospec.storageClassDevices[].devicePaths. - Add a node: add the node hostname to
spec.nodeSelector.nodeSelectorTerms, then list that node's device paths.
After you apply the edit, wait for new PersistentVolumes in Available state: