Configuring Persistent Storage Using Local volumes
Alauda Container Platform can be provisioned with persistent storage by using local volumes. Local persistent volumes allow you to access local storage devices, such as a disk or partition, by using the standard persistent volume claim interface.
Local volumes can be used without manually scheduling pods to nodes because the system is aware of the volume node constraints. However, local volumes are still subject to the availability of the underlying node and are not suitable for all applications.
Local volumes can only be used as a statically created persistent volume.
TOC
Prerequisites
-
Download the Alauda Build of LocalStorage installation package corresponding to your platform architecture.
-
Upload the Alauda Build of LocalStorage installation package using the Upload Packages mechanism.
-
You have a local disk that meets the following conditions:
- It is attached to a node.
- It is not mounted.
- It does not contain partitions.
Procedure
Installing the Local Storage Operator
-
Login, go to the Administrator page.
-
Click Marketplace > OperatorHub to enter the OperatorHub page.
-
Find the Alauda Build of LocalStorage, click Install, and navigate to the Install Alauda Build of LocalStorage page.
Configuration Parameters:
Provisioning local volumes by using the Local Storage Operator
Local volumes cannot be created by dynamic provisioning. Instead, persistent volumes can be created by the Local Storage Operator. The local volume provisioner looks for any file system or block volume devices at the paths specified in the defined resource.
-
Create the local volume resource. This resource must define the nodes and paths to the local volumes.
NOTEDo not use different storage class names for the same device. Doing so will create multiple persistent volumes (PVs).
Execute commands on the control node of the cluster.
- The namespace where the Local Storage Operator is installed, default is
acp-storage. - Optional: A node selector containing a list of nodes where the local storage volumes are attached. This example uses the node hostnames, obtained from
kubectl get node. If a value is not defined, then the Local Storage Operator will attempt to find matching disks on all available nodes. - The name of the storage class to use when creating persistent volume objects. The Local Storage Operator automatically creates the storage class if it does not exist. Be sure to use a storage class that uniquely identifies this set of local volumes.
- Controls whether the operator wipes the listed devices before use. The default is "false". WARNING: Setting
forceWipeDevicesAndDestroyAllData: trueis destructive and will erase existing partition tables/filesystem signatures and data on those devices. Use only when you are certain the devices can be safely wiped. - The volume mode, either
FilesystemorBlock, that defines the type of local volumes. - Optional: The file system that is created when the local volume is mounted for the first time. This parameter must be configured only if
volumeModeset toFilesystem. - The path containing a list of local storage devices to choose from.
- Replace this value with your actual local disks filepath to the
LocalVolumeresourceby-id, such as/dev/disk/by-id/wwn. PVs are created for these local disks when the provisioner is deployed successfully.
- The namespace where the Local Storage Operator is installed, default is
-
Verify that the persistent volumes were created:
Execute commands on the control node of the cluster.
Example output:
NOTEEditing the LocalVolume object does not change the fsType or volumeMode of existing persistent volumes because doing so might result in a destructive operation.
-
Creating the local volume persistent volume claim
Execute commands on the control node of the cluster.
- Name of the PVC.
- The type of the PVC. Defaults to
Filesystem. - The amount of storage available to the PVC.
- Name of the storage class required by the claim.
Automating discovery local storage devices
The Local Storage Operator automates local storage discovery.
Prerequisites
- You have installed the Local Storage Operator.
Procedure
-
Create LocalVolumeDiscovery object
Execute commands on the control node of the cluster.
- Optional: Nodes on which the automatic detection policies must run. If a value is not defined, then the Local Storage Operator will attempt to automatic detection on all available nodes.
- Optional: If specified tolerations is the list of toleration that is passed to the LocalVolumeDiscovery Daemon
-
Verify discover result
Execute commands on the control node of the cluster.
Example output:
A dedicated LocalVolumeDiscoveryResult object is generated for selected nodes in LocalVolumeDiscovery Object, from which you can inspect the block devices discovered on that node.