Creating OLM objects for a specialized installation

A cluster administrator, or a user with the appropriate permissions to install operators, must create the Operator Lifecycle Manager (OLM) objects, such as operators and operator subscriptions, that are required to install the IBM Cloud Pak® for Data platform and services. The OLM objects that you create depend on the services that you plan to install.

Installation phase
You are not here. Setting up a client workstation
You are not here. Collecting required information
You are not here. Preparing your cluster
You are here icon. Installing the Cloud Pak for Data platform and services
Who needs to complete this task?
A user with the appropriate permissions to install operators must complete this task.
When do you need to complete this task?
You must complete this task before you install Cloud Pak for Data for the first time.

Before you begin

If you plan to integrate with the IBM Cloud Pak foundational services Identity and Access Management Service, you must set the default storage class on your cluster to block storage before you install the IBM Cloud Pak foundational services operators.

Important: If you plan to back up and restore your Cloud Pak for Data instance, the storage class must support CSI snapshots.
This requirement does not apply if you plan to use the following backup methods:
  • Creating Restic backups on an S3-compatible object store of Kubernetes metadata and volume data.
  • Creating backups of volume data on a separate Persistent Volume Claim (PVC) or S3-compatible object store.
  1. Check whether there is a default storage class configured on the cluster:
    oc get storageclass

    The default storage class is indicated by (default).

  2. Take the appropriate action for your environment:
    • If no default storage class is defined, run the following command to set the default storage class to block storage:
      oc patch storageclass ${STG_CLASS_BLOCK} \
      --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
    • If the default storage class uses file storage, run the following commands:
      1. Write down the name of the current default storage class.
      2. Set the default storage class to block storage:
        oc patch storageclass ${STG_CLASS_BLOCK} \
        --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
      3. Remove the previous default storage class:
        oc patch storageclass <storage-class-name> \
        --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'

        Replace <storage-class-name> with the name of the current storage class from step a.

  3. Confirm that the STG_CLASS_BLOCK storage class is now the default storage class:
    oc get storageclass
Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

About this task

Use the cpd-cli manage apply-olm command to create the IBM Cloud Pak foundational services operators and the Cloud Pak for Data operators.

The OLM objects are created in two projects:
  • The IBM Cloud Pak foundational services operators are installed in the project specified by the ${PROJECT_CPFS_OPS} environment variable (typically the ibm-common-services project).

    If you install the scheduling service, the operator for this component is also installed in the ibm-common-services project.

  • The Cloud Pak for Data operators are installed in the project specified by the ${PROJECT_CPD_OPS} environment variable.

The instructions assume that you are installing the operators for all of the components at the same time, which enables you to complete the task in fewer steps. You can always install additional operators if you decide to install additional services on your environment.

Procedure

  1. Run the cpd-cli manage login-to-ocp command to log in to the cluster as a user with sufficient permissions to complete this task. For example:
    cpd-cli manage login-to-ocp \
    --username=${OCP_USERNAME} \
    --password=${OCP_PASSWORD} \
    --server=${OCP_URL}
    Tip: The login-to-ocp command takes the same input as the oc login command. Run oc login --help for details.
  2. Create the OLM objects for the specified components:

    IBM Cloud Pak foundational services are in the default project (ibm-common-services)
    Remember: If IBM Cloud Pak foundational services is not installed, this command will automatically create the required OLM objects in the ibm-common-services project.
    cpd-cli manage apply-olm \
    --release=${VERSION} \
    --components=${COMPONENTS} \
    --cpd_operator_ns=${PROJECT_CPD_OPS}

    IBM Cloud Pak foundational services are in a different project
    Remember: If IBM Cloud Pak foundational services is not installed, this command will automatically create the required OLM objects in the project that you specify for the --cs_ns option.
    cpd-cli manage apply-olm \
    --release=${VERSION} \
    --components=${COMPONENTS} \
    --cs_ns=${PROJECT_CPFS_OPS} \
    --cpd_operator_ns=${PROJECT_CPD_OPS}

    Tip: If you want to preview the oc commands that the cpd-cli manage apply-olm will issue on your behalf, you can run the command with --preview=true.

    The oc commands are saved to the preview.sh file in the cpd-cli-workspace/olm-utils-workspace/work directory.

Results

The operators for the specified components are created in the appropriate projects:
  • IBM Cloud Pak foundational services operators are created in ibm-common-services or the project specified by the ${PROJECT_CPFS_OPS} environment variable.
  • The Cloud Pak for Data operators are created in the project specified by the ${PROJECT_CPD_OPS} environment variable.

The operators are created when the apply-olm command returns [SUCCESS]... The apply-olm command ran successfully.

You can optionally run the cpd-cli manage get-olm-artifacts command to get the list of catalog sources and operator subscriptions that are on the cluster.
  • To see the catalog sources and operator subscriptions for the operators in the ${PROJECT_CPFS_OPS} project, run:
    cpd-cli manage get-olm-artifacts \
    --subscription_ns=${PROJECT_CPFS_OPS}
  • To see the catalog sources and operator subscriptions for the operators in the ${PROJECT_CPD_OPS} project, run:
    cpd-cli manage get-olm-artifacts \
    --subscription_ns=${PROJECT_CPD_OPS}

What to do next

Important: Undo the changes that you made to the default storage class. Take the appropriate action for your environment:
  • If no default storage class was defined, run the following command to remove the default storage class:
    oc patch storageclass ${STG_CLASS_BLOCK} \
    --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
  • If the default storage class was previously set to file storage, run the following commands:
    1. Reapply the previous default storage class:
      oc patch storageclass <storage-class-name> \
      --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'

      Replace <storage-class-name> with the name of the previous default storage class.

    2. Update the block storage class to set the is-default-class annotation to false:
      oc patch storageclass ${STG_CLASS_BLOCK} \
      --patch='{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
Now that you've created the OLM objects, you are ready to complete Installing components in a specialized installation.