Setting up Nutanix

If you decide to use Nutanix for persistent storage, you must create a file storage class and a block 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?

Cluster administrator A cluster administrator or storage administrator must complete this task.

When do you need to complete this task?

If you plan to use Nutanix storage and you do not have a file storage class and a block storage class that meets the required criteria, you must complete this task before you install IBM Software Hub.

Before you begin

Ensure that you completed the steps for Nutanix in Installing persistent storage for IBM Software Hub.

About this task

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 NUTANIX_SECRET environment variable to the name that you want to use for the secret that contains your Nutanix credentials.
      export NUTANIX_SECRET=<secret-name>
    2. Set the CSI_DRIVER_NS environment variable to the project where you installed the Nutanix CSI driver.
      export CSI_DRIVER_NS=<project-name>
    3. Set the NUTANIX_PE_CREDENTIALS environment variable to the Nutanix Prism Element virtual IP credentials.
      The credentials have the following format: PE-Virtual-IP:Port:UserName:Password
      export NUTANIX_PE_CREDENTIALS=<credentials>
    4. Set the NUTANIX_FILE_SERVER_CREDENTIALS environment variable to the credentials of the REST API user of the file server.
      You can specify the file server credentials with either of the following formats:
      • File-Server-FQDN:REST-API-Username:Password
      • File-Server-IP:REST-API-Username:Password
      export NUTANIX_FILE_SERVER_CREDENTIALS=<credentials>
    5. Set the NUTANIX_NFS_SERVER_NAME environment variable to the name that you want to use to identify the Nutanix file server:
      export NUTANIX_NFS_SERVER_NAME=<server-name>
    6. Set the NUTANIX_NFS_SERVER_LOCATION environment variable to the IP address or fully qualified domain name (FQDN) of the Nutanix file server:
      export NUTANIX_NFS_SERVER_LOCATION=<server-address>
    7. Set the NUTANIX_NFS_PATH environment variable to the exported path where you want the provisioner to create sub-directories.
      export NUTANIX_NFS_PATH=<path>
    8. Set the STORAGE_CONTAINER_NAME environment variable to the name of the storage container where you want to store volume data.

      You can use default or the name of a storage container that you created when you installed Nutanix.

      export STORAGE_CONTAINER_NAME=<name>
    9. Set the PE_UUID environment variable to the unique identifier of the Nutanix Prism Element cluster where you want to provision the volume storage.
      Tip: You can run the following command from the Nutanix CLI to get the UUID:
      ncli cluster info
      export PE_UUID=<uuid>
  3. Create a secret to connect to the file server and Nutanix Prism Element:
    cat <<EOF |oc apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
     name: ${NUTANIX_SECRET}
     namespace: ${CSI_DRIVER_NS}
    stringData:
      key: "${NUTANIX_PE_CREDENTIALS}"
      files-key: "${NUTANIX_FILE_SERVER_CREDENTIALS}"
    EOF
  4. Create a file storage class with the required settings.

    The following command uses the recommended storage class name, nutanix-file:

    cat <<EOF |oc apply -f -
    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
        name: nutanix-file
    provisioner: csi.nutanix.com
    parameters:
      dynamicProv: ENABLED
      nfsServerName: ${NUTANIX_NFS_SERVER_NAME}
      nfsServer: ${NUTANIX_NFS_SERVER_LOCATION}
      nfsPath: ${NUTANIX_NFS_PATH}
      csi.storage.k8s.io/controller-expand-secret-name: ${NUTANIX_SECRET}
      csi.storage.k8s.io/controller-expand-secret-namespace: ${CSI_DRIVER_NS}
      csi.storage.k8s.io/node-publish-secret-name: ${NUTANIX_SECRET}
      csi.storage.k8s.io/node-publish-secret-namespace: ${CSI_DRIVER_NS}
      csi.storage.k8s.io/provisioner-secret-name: ${NUTANIX_SECRET}
      csi.storage.k8s.io/provisioner-secret-namespace: ${CSI_DRIVER_NS}
      storageType: NutanixFiles
    allowVolumeExpansion: true
    reclaimPolicy: Retain
    volumeBindingMode: Immediate
    EOF
  5. Create a block storage class with the required settings.

    The following command uses the recommended storage class name, nutanix-volume:

    cat <<EOF |oc apply -f -
    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
        name: nutanix-volume
    provisioner: csi.nutanix.com
    parameters:
      csi.storage.k8s.io/fstype: ext4
      storageType: NutanixVolumes
      computeAffinity: DISABLED
      flashMode: DISABLED
      storageContainer: ${STORAGE_CONTAINER_NAME}
      prismElementRef: ${PE_UUID}
    allowVolumeExpansion: true
    reclaimPolicy: Delete
    volumeBindingMode: Immediate
    EOF
  6. Create a volume snapshot storage class.

    The following command uses the recommended storage class name, volumesnapshotclass-nutanix:

    cat <<EOF |oc apply -f -
    kind: VolumeSnapshotClass
    apiVersion: storage.k8s.io/v1
    driver: csi.nutanix.com
    metadata:
        name: volumesnapshotclass-nutanix
    provisioner: 
    parameters:
      csi.storage.k8s.io/snapshotter-secret-name: ${NUTANIX_SECRET}
      csi.storage.k8s.io/snapshotter-secret-namespace: ${CSI_DRIVER_NS}
    deletionPolicy: Retain
    EOF