Provision with LocalVolumeSet
A LocalVolumeSet provisions PersistentVolumes from devices that match a filter. The operator creates the StorageClass named in spec.storageClassName if it does not exist.
Use LocalVolumeSet when disks should be claimed by size, type, or similar properties instead of by an explicit path list. For exact paths, see Provision with LocalVolume.
Use LocalVolumeSet with care. When the operator provisions PersistentVolumes from local disks, it can claim every device that matches deviceInclusionSpec. Alauda Container Platform Local Disk Provisioner must be the only component managing those disks on the node. Do not create more than one LocalVolumeSet that selects the same node. Set maxDeviceCount when you must cap how many devices are provisioned per node.
LocalVolumeSet does not support logical volume management (LVM) devices. Do not point it at LVM volumes. Use LVM Storage for LVM-backed dynamic volumes.
Prerequisites
- Alauda Container Platform Local Disk Provisioner is installed. See Install.
- Device discovery is running so you can confirm which disks are
Available. See Discover local disks. - Matching devices are attached, not mounted, and have no child partitions when you select whole disks.
Provision Block volumes
This example creates a Block StorageClass named localblock and PersistentVolumes from matching whole disks.
On a control plane node:
- Namespace where Alauda Container Platform Local Disk Provisioner is installed. The default is
acp-storage. - StorageClass for provisioned PersistentVolumes. The operator creates it if it does not exist. Use a name that uniquely identifies this set.
BlockorFilesystem. For Ceph OSD consumption and other raw-device users, useBlock.- Optional. Maximum number of matching devices provisioned per node. If omitted, every matching device on the selected nodes is claimed.
- Optional. Nodes that run matching. Get hostnames from
kubectl get node. If omitted, matching runs on every node. - Device types to include:
disk,part,loop, ormpath. If the list is empty, onlydiskis selected. LVM devices are not supported.
Optional deviceInclusionSpec filters:
If MODEL or VENDOR is empty (common on Virtio and many cloud disks), do not set models or vendors. Those filters will not match an empty string.
Verify PersistentVolumes:
Example output:
A disk that is plugged in later is provisioned automatically if it matches the filter and maxDeviceCount still allows it.
Bind a PersistentVolumeClaim
Create the claim in the project that will use the volume. For Block volumes, set volumeMode: Block. The request must not exceed the device capacity.
- Must match the
LocalVolumeSetvolumeMode. - Must be less than or equal to the PersistentVolume capacity.
- Must match
spec.storageClassName.
Confirm the claim is bound:
Add disks or nodes
- Add a disk: attach a disk that matches
deviceInclusionSpecon a selected node. The operator provisions a PersistentVolume when the disk isAvailableandmaxDeviceCountis not exceeded. You do not edit a path list. - Add a node: add the hostname to
spec.nodeSelectoron both theLocalVolumeSetand theLocalVolumeDiscoverythat inventories that node. See Discover local disks.