OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Chapter 1. Deploying OpenShift Data Foundation on single node OpenShift clusters using RHACM
1.1. Requirements for deploying using RHACM Copy linkLink copied to clipboard!
Before you begin deploying OpenShift Data Foundation Logical Volume Manager Operator on single node Openshift clusters, ensure that the following requirements are met:
- You have installed Red Hat Advanced Cluster Management for Kubernetes (RHACM) on an OpenShift cluster. For information, see Red Hat Advanced Cluster Management for Kubernetes: Install.
- Every managed SNO cluster has dedicated disks that are used to provision storage.
1.2. Installing the OpenShift Data Foundation Logical Volume Manager Operator using RHACM Copy linkLink copied to clipboard!
The OpenShift Data Foundation Logical Volume Manager Operator is deployed on single node OpenShift (SNO) clusters using Red Hat Advanced Cluster Management for Kubernetes (RHACM). You create a Policy on RHACM that deploys and configures the operator when it is applied to managed clusters which match the selector specified in the PlacementRule. The policy is also applied to clusters that are imported later and satisfy the PlacementRule.
Prerequisites
-
Access to the RHACM cluster using an account with
cluster-adminand operator installation permissions. - Dedicated disks on each SNO cluster to be used by OpenShift Data Foundation Logical Volume Manager Operator.
Ensure that no other storage provisioner is installed on the SNO cluster. OpenShift Data Foundation Logical Volume Manager Operator should be the only storage provisioner as it uses all available disks on the node.
Procedure
Log in to the RHACM CLI using your OpenShift credentials.
For more information, see Install Red Hat Advanced Cluster Management for Kubernetes.
Create a namespace in which you will create policies.
oc create ns lvm-policy-ns
# oc create ns lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Save the following YAML to a file with a name such as
policy-lvm-operator.yamlto create a policy.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the policy in the namespace by running the following command:
oc create -f policy-lvm-operator.yaml -n lvm-policy-ns
# oc create -f policy-lvm-operator.yaml -n lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow where,
policy-lvm-operator.yamlis the name of the file to which the policy is saved.This creates a
Policy, aPlacementRule, and aPlacementBindingin the namespace,lvm-policy-ns. ThePolicycreates aNamespace,OperatorGroup,Subscription, andLVMClusterresource on the clusters matching the PlacementRule. This deploys the operator on the SNO clusters which match the selection criteria and configures it to set up the required resources to provision storage. The operator uses all the unused disks after installation.
1.3. Uninstalling OpenShift Data Foundation Logical Volume Manager Operator installed using RHACM Copy linkLink copied to clipboard!
To uninstall OpenShift Data Foundation Logical Volume Manager Operator when you have installed the operator using RHACM, you need to delete the ACM policy that you created for deploying and configuring the operator. However, when you delete the ACM policy, the resources that the policy has created are not removed. You need to create additional policies to remove the resources.
As the resources that are created are not removed when you delete the policy, you need to perform the following steps:
- Remove all the PVCs and volume snapshots provisioned by the Logical Volume Manager Operator.
-
Remove the
LVMClusterresources to clean up the Logical Volume Manager resources created on the disks. - Create an additional policy to uninstall the operator.
Prerequisites
Ensure that the following are deleted before deleting the policy:
- All the applications on the managed clusters that are using the storage provisioned by the OpenShift Data Foundation Logical Volume Manager Operator.
- Persistent volume claims (PVCs) and persistent volumes (PVs) provisioned using the OpenShift Data Foundation Logical Volume Manager Operator.
- All volume snapshots provisioned by the OpenShift Data Foundation Logical Volume Manager Operator.
-
Ensure that no logical volume resources exist by using the
oc get logicalvolumecommand. -
Access to the RHACM cluster using an account with
cluster-adminrole.
Procedure
In the OpenShift command-line interface, delete the ACM policy that you created for deploying and configuring the OpenShift Data Foundation Logical Volume Manager Operator on the hub cluster by using the following command:
oc delete -f policy-lvm-operator.yaml -n lvm-policy-ns
# oc delete -f policy-lvm-operator.yaml -n lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Save the following YAML to a file with a name such as
odf-lvmcluster-deletion.yamlto create a policy for removing theLVMCluster. This enables the operator to clean up all the Logical Volume Manager resources that it created on the cluster.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the policy by running the following command:
oc create -f odf-lvmcluster-deletion.yaml -n lvm-policy-ns
# oc create -f odf-lvmcluster-deletion.yaml -n lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Save the following YAML to a file with a name such as
check-odf-lvmcluster-deletion.yamlto create a policy to check if theLVMClusterCR has been removed.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the policy by running the following command:
oc create -f check-odf-lvmcluster-deletion.yaml -n lvm-policy-ns
# oc create -f check-odf-lvmcluster-deletion.yaml -n lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the policy status.
oc get policy -n lvm-policy-ns NAME REMEDIATION ACTION COMPLIANCE STATE AGE policy-lvmcluster-delete enforce Compliant 15m policy-lvmcluster-inform inform Compliant 15m
# oc get policy -n lvm-policy-ns NAME REMEDIATION ACTION COMPLIANCE STATE AGE policy-lvmcluster-delete enforce Compliant 15m policy-lvmcluster-inform inform Compliant 15mCopy to Clipboard Copied! Toggle word wrap Toggle overflow After both the policies are compliant, save the following YAML to a file with a name such as
odf-lvm-operator-remove-policy.yamlto create a policy to uninstall the OpenShift Data Foundation Logical Volume Manager Operator.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the policy by running the following command:
oc create -f odf-lvm-operator-remove-policy.yaml -ns lvm-policy-ns
# oc create -f odf-lvm-operator-remove-policy.yaml -ns lvm-policy-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow