Setting up NetApp Trident

If you decide to use NetApp Trident for persistent storage, you must create a storage class with the appropriate settings for use with IBM® Software Hub.

Installation phase
  • You are not here. Setting up a client workstation
  • You are not here. Setting up a cluster
  • You are not here. Collecting required information
  • You are not here. Preparing to run installs in a restricted network
  • You are not here. Preparing to run installs from a private container registry
  • You are here icon. Preparing the cluster for IBM Software Hub
  • You are not here. Preparing to install an instance of IBM Software Hub
  • You are not here. Installing an instance of IBM Software Hub
  • You are not here. Setting up the control plane
  • You are not here. Installing solutions and services
Who needs to complete this task?
A cluster administrator or a storage administrator must complete this task.
When do you need to complete this task?
If you plan to use NetApp Trident storage and you do not have a storage class that meets the required criteria, you must complete this task before you install IBM Software Hub.

Before you begin

Ensure you completed the steps for NetApp Trident in Installing persistent storage for IBM Software Hub.

About this task

To set up NetApp Trident for IBM Software Hub, you must:
  • Create a storage class with read, write, and execute permissions on the local file system.
  • Create a volume snapshot storage class for backing up IBM Software Hub.
Remember: Storage classes are cluster-wide resources.

Procedure

  1. Log in to Red Hat OpenShift Container Platform as a user with sufficient permissions to complete the task.
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Set the following environment variables:
    1. Set the NETAPP_USERNAME environment variable to the username of the user who provisioned the storage.
      export NETAPP_USERNAME=<username>
    2. Set the NETAPP_PASSWORD environment variable to the password of the user who provisioned the storage.
      export NETAPP_PASSWORD=<password>
    3. Set the TRIDENT_OPERATOR_NAMESPACE environment variable to the OpenShift project where the NetApp Trident operator is installed.
      export TRIDENT_OPERATOR_NAMESPACE=<operator-namespace>
    4. Set the MANAGEMENT_LIF environment variable to the IP address associated with the NetApp Trident LIF.

      For more information, see Display LIF information in the NetApp Trident documentation.

      export MANAGEMENT_LIF=<management-lif>
    5. Set the STORAGE_VM environment variable to the storage virtual machine (SVM) that you want to set up.

      For more information, see Viewing the Storage VM list and details in the NetApp Trident documentation.

      export STORAGE_VM=<storage-vm>
  3. Create a secret for the backend:
    cat <<EOF |oc apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: backend-tbc-ontap-nas-advanced-secret
      namespace: ${TRIDENT_OPERATOR_NAMESPACE}
    type: Opaque
    stringData:
      username: ${NETAPP_USERNAME}
      password: ${NETAPP_PASSWORD}
    EOF
  4. Create the backend.
    Run the appropriate command for your storage type.
    Self-managed NetApp Trident
    cat <<EOF |oc apply -f -
    apiVersion: trident.netapp.io/v1
    kind: TridentBackendConfig
    metadata:
      name: backend-tbc-ontap-nas-advanced
      namespace: ${TRIDENT_OPERATOR_NAMESPACE}
    spec:
      version: 1
      storageDriverName: ontap-nas
      managementLIF: ${MANAGEMENT_LIF}
      backendName: tbc-ontap-nas-advanced
      svm: ${STORAGE_VM}
      credentials:
        name: backend-tbc-ontap-nas-advanced-secret
      nfsMountOptions: nfsvers=3,nolock
      autoExportPolicy: true
      defaults:
        spaceReserve: none
      deletionPolicy: delete
    EOF

    Amazon FSx for NetApp ONTAP
    cat <<EOF |oc apply -f -
    apiVersion: trident.netapp.io/v1
    kind: TridentBackendConfig
    metadata:
      name: backend-fsx-ontap-nas
      namespace: ${TRIDENT_OPERATOR_NAMESPACE}
    spec:
      version: 1
      backendName: tbc-ontap-nas-advanced
      storageDriverName: ontap-nas
      managementLIF: ${MANAGEMENT_LIF}
      svm: ${STORAGE_VM}
      credentials:
        name: backend-tbc-ontap-nas-advanced-secret
      nfsMountOptions: nfsvers=3,nolock
    EOF

  5. Check whether the TridentBackendConfig custom resource was successfully created and bound.
    Run the appropriate command for your storage type.
    Self-managed NetApp Trident
    oc get tbc backend-tbc-ontap-nas-advanced \
    --namespace=${TRIDENT_OPERATOR_NAMESPACE}

    Amazon FSx for NetApp ONTAP
    oc get tbc backend-fsx-ontap-nas \
    --namespace=${TRIDENT_OPERATOR_NAMESPACE}

  6. Create the storage class.

    The following sample includes the minimum required information for the storage class:

    cat <<EOF |oc apply -f -
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: ontap-nas
    provisioner: csi.trident.netapp.io
    parameters:
      backendType: ontap-nas
      storagePools: "tbc-ontap-nas-advanced:.*"
      fsType: "nfs"
    allowVolumeExpansion: true
    mountOptions:
    - nfsvers=3
    - nolock
    EOF
  7. Create the following volume snapshot storage class:
    cat << EOF | oc apply -f -
    apiVersion: snapshot.storage.k8s.io/v1
    kind: VolumeSnapshotClass
    metadata:
      name: csi-snapclass
      labels:
        velero.io/csi-volumesnapshot-class: "true"
    driver: csi.trident.netapp.io
    deletionPolicy: Retain
    EOF

What to do next

Now that you've created the storage class, you are ready to complete Creating custom security context constraints for services.