5.4. Persistent storage using logical volume manager storage
Logical Volume Manager (LVM) Storage uses LVM2 through the TopoLVM CSI driver to dynamically provision local storage on a cluster with limited resources. With LVM Storage, you can create volume groups, persistent volume claims (PVCs), snapshots, and clones.
5.4.1. Logical Volume Manager Storage installation 링크 복사링크가 클립보드에 복사되었습니다!
You can install LVM Storage on an OpenShift Container Platform cluster and configure it to dynamically provision storage for your workloads.
You can install LVM Storage by using the OpenShift Container Platform CLI (oc), OpenShift Container Platform web console, or Red Hat Advanced Cluster Management (RHACM).
When using LVM Storage on multi-node clusters, LVM Storage only supports provisioning local storage. LVM Storage does not support storage data replication mechanisms across nodes. You must ensure storage data replication through active or passive replication mechanisms to avoid a single point of failure.
5.4.1.1. Prerequisites to install LVM Storage 링크 복사링크가 클립보드에 복사되었습니다!
The prerequisites to install LVM Storage are as follows:
- Ensure that you have a minimum of 10 milliCPU and 100 MiB of RAM.
- Ensure that every managed cluster has dedicated disks that are used to provision storage. LVM Storage uses only those disks that are empty and do not contain file system signatures. To ensure that the disks are empty and do not contain file system signatures, wipe the disks before using them.
Before installing LVM Storage in a private CI environment where you can reuse the storage devices that you configured in the previous LVM Storage installation, ensure that you have wiped the disks that are not in use. If you do not wipe the disks before installing LVM Storage, you cannot reuse the disks without manual intervention.
참고You cannot wipe the disks that are in use.
- If you want to install LVM Storage by using Red Hat Advanced Cluster Management (RHACM), ensure that you have installed RHACM on an OpenShift Container Platform cluster. For more information, see "Installing LVM Storage by using RHACM".
5.4.1.2. Installing LVM Storage by using the CLI 링크 복사링크가 클립보드에 복사되었습니다!
You can install LVM Storage by using the OpenShift CLI (oc) to dynamically provision local storage on clusters with limited resources.
The default namespace for the LVM Storage Operator is openshift-lvm-storage.
Prerequisites
-
You have installed the OpenShift CLI (
oc). -
You have logged in to OpenShift Container Platform as a user with
cluster-adminand Operator installation permissions.
Procedure
Create a YAML file with the configuration for creating a namespace:
Example YAML configuration for creating a namespace
apiVersion: v1 kind: Namespace metadata: labels: openshift.io/cluster-monitoring: "true" pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/audit: privileged pod-security.kubernetes.io/warn: privileged name: openshift-lvm-storageCreate the namespace by running the following command:
$ oc create -f <file_name>Create an
OperatorGroupCR YAML file:Example
OperatorGroupCRapiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: openshift-storage-operatorgroup namespace: openshift-lvm-storage spec: targetNamespaces: - openshift-storageCreate the
OperatorGroupCR by running the following command:$ oc create -f <file_name>Create a
SubscriptionCR YAML file:Example
SubscriptionCRapiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: lvms namespace: openshift-lvm-storage spec: installPlanApproval: Automatic name: lvms-operator source: redhat-operators sourceNamespace: openshift-marketplaceCreate the
SubscriptionCR by running the following command:$ oc create -f <file_name>
Verification
To verify that LVM Storage is installed, run the following command:
$ oc get csv -n openshift-lvm-storage -o custom-columns=Name:.metadata.name,Phase:.status.phaseExample output
Name Phase 4.13.0-202301261535 Succeeded
5.4.1.3. Installing LVM Storage by using the web console 링크 복사링크가 클립보드에 복사되었습니다!
Install LVM Storage from the OpenShift Container Platform web console to dynamically provision local storage on clusters with limited resources.
The default namespace for the LVM Storage Operator is openshift-lvm-storage.
Prerequisites
- You have access to the cluster.
-
You have access to OpenShift Container Platform with
cluster-adminand Operator installation permissions.
Procedure
- Log in to the OpenShift Container Platform web console.
-
Click Ecosystem
Software Catalog. - Click LVM Storage on the software catalog page.
Set the following options on the Operator Installation page:
- Update Channel as stable-5.0.
- Installation Mode as A specific namespace on the cluster.
-
Installed Namespace as Operator recommended namespace openshift-storage. If the
openshift-lvm-storagenamespace does not exist, it is created during the operator installation. Update approval as Automatic or Manual.
참고If you select Automatic updates, the Operator Lifecycle Manager (OLM) automatically updates the running instance of LVM Storage without any intervention.
If you select Manual updates, the OLM creates an update request. As a cluster administrator, you must manually approve the update request to update LVM Storage to a newer version.
- Optional: Select the Enable Operator recommended cluster monitoring on this Namespace checkbox.
- Click Install.
Verification
- Verify that LVM Storage shows a green tick, indicating successful installation.
5.4.1.4. Installing LVM Storage in a disconnected environment 링크 복사링크가 클립보드에 복사되었습니다!
Install LVM Storage in a disconnected environment where your cluster has no internet access, such as air-gapped networks, high-security facilities, or regulated industries requiring network isolation for security and compliance.
Prerequisites
- You read "About disconnected installation mirroring".
- You have access to the OpenShift Container Platform image repository.
- You created a mirror registry (see "Creating a mirror registry with mirror registry for Red Hat OpenShift").
Procedure
Follow the steps in the "Creating the image set configuration" procedure. To create an
ImageSetConfigurationcustom resource (CR) for LVM Storage, you can use the following exampleImageSetConfigurationCR configuration:Example
ImageSetConfigurationCR for LVM Storagekind: ImageSetConfiguration apiVersion: mirror.openshift.io/v1alpha2 archiveSize: 4 storageConfig: registry: imageURL: example.com/mirror/oc-mirror-metadata skipTLS: false mirror: platform: channels: - name: stable-5.0 type: ocp graph: true operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v5.0 packages: - name: lvms-operator channels: - name: stable additionalImages: - name: registry.redhat.io/ubi9/ubi:latest helm: {}-
archiveSize: Specifies the maximum size (in GiB) of each file within the image set. -
storageConfig: Specifies the location in which you want to save the image set. This location can be a registry or a local directory. You must configure thestorageConfigfield unless you are using the Technology Preview OCI feature. -
storageConfig.registry.imageURL: Specifies the storage URL for the image stream when using a registry. For more information, see "Why use imagestreams". -
mirror.platform.name: Specifies the channel from which you want to retrieve the OpenShift Container Platform images. -
mirror.platform.channels[].name: Set this field totrueto generate the OpenShift Update Service (OSUS) graph image. For more information, see "About the OpenShift Update Service". -
mirror.operators.catalog: Specifies the Operator catalog from which you want to retrieve the OpenShift Container Platform images. -
mirror.operators.packages.name: Specifies the Operator packages to include in the image set. If this field is empty, all packages in the catalog are retrieved. -
mirror.operators[].packages[].channels.name: Specifies the channels of the Operator packages to include in the image set. You must include the default channel for the Operator package even if you do not use the bundles in that channel. You can find the default channel by running the following command:$ oc mirror list operators --catalog=<catalog_name> --package=<package_name>. -
mirror.additionalImages.name: Specifies any additional images to include in the image set.
-
- Follow the procedure in "Mirroring an image set to a mirror registry".
- Follow the procedure in "Configuring image registry repository mirroring".
5.4.1.5. Installing LVM Storage by using RHACM 링크 복사링크가 클립보드에 복사되었습니다!
To install LVM Storage on clusters by using Red Hat Advanced Cluster Management (RHACM), you must create a Policy custom resource (CR) and configure the criteria to select the target clusters.
The Policy CR that is created to install LVM Storage is also applied to the clusters that are imported or created after creating the Policy CR.
Prerequisites
-
You have access to the RHACM cluster using an account with
cluster-adminand Operator installation permissions. - You have dedicated disks that LVM Storage can use on each cluster.
- The cluster must be managed by RHACM.
Procedure
- Log in to the RHACM CLI using your OpenShift Container Platform credentials.
Create a namespace.
$ oc create ns <namespace>Create a
PolicyCR YAML file:Example
PolicyCR to install and configure LVM StorageapiVersion: apps.open-cluster-management.io/v1 kind: PlacementRule metadata: name: placement-install-lvms spec: clusterConditions: - status: "True" type: ManagedClusterConditionAvailable clusterSelector: matchExpressions: - key: mykey operator: In values: - myvalue --- apiVersion: policy.open-cluster-management.io/v1 kind: PlacementBinding metadata: name: binding-install-lvms placementRef: apiGroup: apps.open-cluster-management.io kind: PlacementRule name: placement-install-lvms subjects: - apiGroup: policy.open-cluster-management.io kind: Policy name: install-lvms --- apiVersion: policy.open-cluster-management.io/v1 kind: Policy metadata: annotations: policy.open-cluster-management.io/categories: CM Configuration Management policy.open-cluster-management.io/controls: CM-2 Baseline Configuration policy.open-cluster-management.io/standards: NIST SP 800-53 name: install-lvms spec: disabled: false remediationAction: enforce policy-templates: - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: install-lvms spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: labels: openshift.io/cluster-monitoring: "true" pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/audit: privileged pod-security.kubernetes.io/warn: privileged name: openshift-lvm-storage - complianceType: musthave objectDefinition: apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: openshift-storage-operatorgroup namespace: openshift-lvm-storage spec: targetNamespaces: - openshift-lvm-storage - complianceType: musthave objectDefinition: apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: lvms namespace: openshift-lvm-storage spec: installPlanApproval: Automatic name: lvms-operator source: redhat-operators sourceNamespace: openshift-marketplace remediationAction: enforce severity: low-
spec.clusterSelector: Set thekeyfield andvaluesfield inPlacementRule.spec.clusterSelectorto match the labels that are configured in the clusters on which you want to install LVM Storage. -
spec.policy-templates[0].objectDefinition[0].spec.object-templates[0].objectDefinition: Specifies the namespace configuration. -
spec.policy-templates[0].objectDefinition[1].spec.object-templates[1].objectDefinition: Specifies theOperatorGroupCR configuration. -
spec.policy-templates[0].objectDefinition.spec.object-templates[2].objectDefinition:Specifies theSubscriptionCR configuration.
-
Create the
PolicyCR by running the following command:$ oc create -f <file_name> -n <namespace>Upon creating the
PolicyCR, the following custom resources are created on the clusters that match the selection criteria configured in thePlacementRuleCR:-
Namespace -
OperatorGroup Subscription참고The default namespace for the LVM Storage Operator is
openshift-lvm-storage.
-