OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Chapter 2. Installing the OpenShift Data Foundation Logical Volume Manager Operator using RHACM
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 be applied to clusters that are imported later and satisfy the PlacementRule
.
Prerequisites
-
Access to the RHACM cluster using an account with
cluster-admin
and 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.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create ns lvm-policy-ns
# oc create ns lvm-policy-ns
Create the policy YAML in the namespace.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This policy verifies the installation of the official version of the OpenShift Data Foundation Logical Volume Manager Operator on the managed clusters. If set to "enforce" it installs the operator. Used APIs: OLM, ODF-LVMO #https://github.com/operator-framework/operator-lifecycle-manager https://github.com/red-hat-storage/lvm-operator
# This policy verifies the installation of the official version of the OpenShift Data Foundation # Logical Volume Manager Operator on the managed clusters. # If set to "enforce" it installs the operator. # Used APIs: OLM, ODF-LVMO #https://github.com/operator-framework/operator-lifecycle-manager # https://github.com/red-hat-storage/lvm-operator 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: policy-lvm-operator spec: disabled: false remediationAction: enforce policy-templates: - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: policy-lvm-namespace spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: openshift-storage labels: openshift.io/cluster-monitoring: "true" remediationAction: enforce severity: high - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: policy-lvm-operator-operatorgroup spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: operators.coreos.com/v1alpha2 kind: OperatorGroup metadata: name: openshift-storage-operatorgroup namespace: openshift-storage spec: targetNamespaces: - openshift-storage remediationAction: enforce severity: high - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: policy-lvm-operator-subscription spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: odf-lvm-operator namespace: openshift-storage spec: channel: stable-4.10 installPlanApproval: Automatic name: odf-lvm-operator source: redhat-operators sourceNamespace: openshift-marketplace startingCSV: odf-lvm-operator.v4.10.0 remediationAction: enforce severity: high - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: policy-lvmcluster spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: lvm.topolvm.io/v1alpha1 kind: LVMCluster metadata: name: odf-lvmcluster namespace: openshift-storage spec: storage: deviceClasses: - name: vg1 remediationAction: enforce severity: high
Run the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create -f policy-lvm-operator.yaml -n lvm-policy-ns
# oc create -f policy-lvm-operator.yaml -n lvm-policy-ns
This creates a
Policy
, aPlacementRule
, and aPlacementBinding
. ThePolicy
creates aNamespace
,OperatorGroup
,Subscription
, andLVMCluster
resource. This deploys the operator on the SNO clusters which match the selection criteria and configures it to set up the required resources in order to provision storage. The operator uses all the unused disks after installation.