manage apply-olm

Create or update the catalog sources, cluster service versions, and operator subscriptions for the specified components.

Extended description

The apply-olm command creates or updates the following objects on your cluster.
Catalog sources

A catalog source is a way to introduce new software or new versions of software to the cluster. A catalog source is a repository of operator versions (as specified by a cluster service version), custom resource definitions (CRDs), and packages that comprise an application. The information provided by the catalog source enables OLM to discover and install operators and their dependencies.

The apply-olm command creates the catalog sources for the components that you want to install.

Cluster service versions
A cluster service version (CSV) represents a specific version of an operator. The information provided by the CSV enables OLM to:
  • Understand the custom resources that the operator manages or depends on
  • Introduce the custom resource definition (CRD), if it doesn't exist
  • Set up the operator's service accounts
  • Start up the operator deployment
  • Keep the operator running safely on the cluster
  • Understand how updates should be applied when new versions of the operator are available on the cluster

The apply-olm command creates the cluster service versions for the components that you want to install.

Operator subscriptions
An operator subscription provides the following information to OLM:
  • The name of the operator
  • The location to install the operator
  • The channel to subscribe to
  • The install plan approval mechanism to use
  • The catalog source to use

The apply-olm command creates the operator subscriptions for the components that you want to install.

For more information, see Cloud Pak for Data operators.

Syntax

cpd-cli manage apply-olm \
--components=<comma-separated-list-of-component-names> \
--release=<version> \
[--upgrade=true|false] \
[--cpd_operator_ns=<project-name>] \
[--cs_ns=<project-name>] \
[--case_download=true|false] \
[--catsrc=true|false] \
[--sub=true|false] \
[--param-file=<file-name>] \
[--preview=true|false]
[-v][-vv][-vvv]

Arguments

The apply-olm command has no arguments.

Options

Option Description
--case_download Specify whether to download the CASE packages for the specified components if they are not detected in the work directory.
Important: The command will fail if the CASE packages are not in the cpd-cli-workspace/olm-utils-workspace/work directory.
Status
Optional.
Syntax
--case_download=true|false
Default value
true

If you omit this option, the default value is used.

Valid values
false
Specify false if either of these statements apply:
  • You are running the commands in a restricted network

    You can set this option to false after you transfer the contents of the cpd-cli-workspace/olm-utils-workspace/work directory behind the firewall.

  • You are not allowed to download the CASE packages directly from GitHub.

    You must ensure that the CASE packages are already in the cpd-cli-workspace/olm-utils-workspace/work directory before you run the command.

true
If the CLI does not detect the CASE packages in the cpd-cli-workspace/olm-utils-workspace/work directory, the command will automatically download the images.
--catsrc Specify whether to create the catalog source objects for the specified components.

You must create the catalog source objects for any services that you plan to install.

Status
Optional.
Syntax
--catsrc=true|false
Default value
true

If you omit this option, the default value is used.

Valid values
false
Do not create the catalog source objects for the specified components.

For example, specify false if you already ran the apply-olm to create the catalog source objects.

true
Create the catalog source objects for the specified components.
--cpd_operator_ns Specialized installations only. The project (namespace) where you want to install the IBM Cloud Pak for Data software operators.
In a specialized installation:
  • The IBM Cloud Pak® foundational services operators are installed in the ibm-common-services project (namespace).
  • The Cloud Pak for Data operators are installed in a separate project (namespace) of your choosing.

For more information about specialized installations, see Operator installation architecture.

Status
Required if you want to install the Cloud Pak for Data operators in a separate project from the IBM Cloud Pak foundational services operators.
Syntax
--cpd_operator_ns=<project-name>
Default value
No default. User-defined.
Valid values
The name of an existing project (namespace) on the cluster.
--components A comma-separated list of the components that you want to install or upgrade.
Status
Ignored when --upgrade=true.
Syntax
--components=<comma-separated-list-of-component-names>
Default value
There is no default value. The list depends on which components you want to install or upgrade.
Valid values
For the list of components, see Component IDs.

You can specify individual components or a comma-separated list of components.

--cs_ns The project where IBM Cloud Pak foundational services are installed or will be installed.
Status
Required for specialized installations (installations where IBM Cloud Pak foundational services operators are in a different project from the Cloud Pak for Data operators).
Syntax
--cs_ns=<project-name>
Default value
ibm-common-services

If you omit this option, the default value is used.

Valid values
The name of an existing project (namespace) on the cluster.

If IBM Cloud Pak foundational services are already installed on the cluster, specify the project where IBM Cloud Pak foundational services is installed

--param-file The fully qualified path of a file that includes additional parameters.

Create the file in the cpd-cli-workspace/olm-utils-workspace/work directory.

Status
Optional.

Refer to the installation documentation for the specified components for guidance.

Syntax
--param-file=/tmp/work/<param-file-name>
Default value
No default. User-defined.
Valid values
The fully qualified path of a file that includes additional parameters.
--preview Preview the commands that run when you issue this CLI command.

The command issues a series of oc commands. You can optionally see the list of oc commands that are associated with the command.

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

Status
Optional.
Syntax
--preview=true|false
Default value
false

If you omit this option, the default value is used.

Valid values
false
Run the commands to apply the changes to your cluster.
true
Preview the commands without running them.

You can optionally copy the oc commands from the output and run them yourself. However, this method is not recommended. When you run the commands manually, you do not have access to the additional helper scripts that are included in the underlying Ansible® playbook.

--release The release that you want to install or upgrade to.
Status
Required.
Syntax
--release=<version>
Default value
No default. You must specify the release.
Valid values
  • 4.6.0
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.6.5
  • 4.6.6
--sub Specify whether to create the operator subscriptions for the specified components.

You must create the operator subscriptions for any services that you plan to install.

Status
Optional.
Syntax
--sub=true|false
Default value
true

If you omit this option, the default value is used.

Valid values
false
Do not create the operator subscriptions for the specified components.

For example, specify false if you want to create and validate the catalog source objects before you create the operator subscriptions.

true
Create the operator subscriptions for the specified components.
--upgrade Specify whether you are upgrading an existing installation. You must set this option to true to upgrade the software.
Status
Required when you run an upgrade.
Syntax
--upgrade=true|false
Default value
false

If you omit this option, the default value is used.

Valid values
false
Do not upgrade the OLM artifacts.
true
Upgrade the OLM artifacts.
-v
-vv
-vvv
Display verbose output.

Options are listed from least verbose to the most verbose.

Status
Optional.
Syntax
Verbose output
-v
Very verbose output
-vv
Most verbose output
-vvv
Default value
Not applicable.
Valid values
Not applicable.

Examples

Note: The following example uses the recommended installation environment variables.

Use a script to create environment variables with the correct values for your environment. For details, see Best practice: Setting up install variables.

Create the OLM artifacts for the specified components
For an express installation, where all of the operators are installed in the same project (namespace):
cpd-cli manage apply-olm \
--release=${VERSION} \
--components=${COMPONENTS}
For a specialized installation, where the Cloud Pak for Data operators are installed in a separate project (namespace):
cpd-cli manage apply-olm \
--release=${VERSION} \
--components=${COMPONENTS} \
--cpd_operator_ns=${PROJECT_CPD_OPS}
Preview the oc commands to create the OLM artifacts for the specified components
cpd-cli manage apply-olm \
--release=${VERSION} \
--components=${COMPONENTS} \
--preview=true
Upgrade the OLM artifacts for the specified components
cpd-cli manage apply-olm \
--release=${VERSION} \
--components=${COMPONENTS} \
--upgrade=true
Download the CASE packages for the specified components without creating any OLM artifacts
This command also saves the CASE packages to a different directory on the client workstation.
cpd-cli manage apply-olm \
--release=${VERSION} \
--components=${COMPONENTS} \
--catsrc=false \
--sub=false \
--offline_dir=${OFFLINEDIR_CPD}