Install DirectPV on OpenShift

This page documents the installation and management of MinIO DirectPV using MinIO’s Red Hat OpenShift-certified operator. DirectPV supports installation onto OpenShift v4.11 through v4.18.

Prerequisites

OpenShift release

DirectPV supports installation onto OpenShift versions 4.11 through 4.18.

Authorization

This procedure assumes that the user interacting with the OpenShift cluster has authorization to:

  • Install Kubernetes operators and associated resources including CustomResourceDefinitions, StatefulSets, and Secrets into new or existing Namespaces.
  • Perform operations as a user that has broad permissions to create resources within multiple Namespaces.

Install DirectPV

  1. Create the Namespace.

    Add a namespace to host DirectPV resources.

    apiVersion: v1
    kind: Namespace
    metadata:
      name: directpv
      labels:
        app.kubernetes.io/managed-by: Helm
        kubernetes.io/metadata.name: directpv
      annotations:
        meta.helm.sh/release-name: directpv
        meta.helm.sh/release-namespace: directpv
    
    oc apply -f namespace.yaml
    
  2. Create the Subscription.

    Install the DirectPV Operator subscription to manage deployments and updates.

    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: minio-directpv
      namespace: openshift-operators
    spec:
      channel: stable
      installPlanApproval: Automatic
      name: minio-directpv
      source: certified-operators
      sourceNamespace: openshift-marketplace
    
    oc apply -f subscription.yaml
    
  3. Create the DirectPV Custom Resource.

    Specify the deployment settings for DirectPV.

    apiVersion: charts.quay.io/v1alpha1
    kind: Directpv
    metadata:
      name: directpv
    spec:
      controller:
        replicas: 3
      images:
        pullPolicy: IfNotPresent
      nodeserver:
        nodeSelector: {}
        tolerations: []
    
    oc apply -f cr.yaml
    
  4. Verify the installation.

    Confirm that the Operator has successfully deployed all DirectPV components.

    # Check operator
    oc get csv -n openshift-operators | grep directpv
    
    # Check CRD
    oc get crd directpvs.charts.quay.io
    
    # Check DirectPV pods
    oc get pods -n directpv
    
  5. Next Steps

    Once you have installed DirectPV, you can prepare drives for provisioning. You can then dynamically allocate storage to pods by specifying storageClass: directpv-min-io when constructing the Persistent Volume Claim.