Install a cluster extension in all namespaces

You can install an extension from a catalog by creating a custom resource (CR) and applying it to the cluster. Operator Lifecycle Manager (OLM) v1 supports installing cluster extensions, including OLM (Classic) Operators in the registry+v1 bundle format, that are scoped to the cluster.

Note

For Red Hat OpenShift Container Platform {product-version}, documented procedures for OLM v1 are CLI-based only. Alternatively, administrators can create and view related objects in the web console by using normal methods, such as the Import YAML and Search pages. However, the existing Software Catalog and Installed Operators pages do not yet display OLM v1 components.

Prerequisites
  • You have created a service account and assigned enough role-based access controls (RBAC) to install, update, and manage the extension that you want to install. For more information, see "Cluster extension permissions".

Procedure
  1. Create a CR, similar to the following example:

    apiVersion: olm.operatorframework.io/v1
      kind: ClusterExtension
      metadata:
        name: <clusterextension_name>
      spec:
        namespace: <installed_namespace>
        serviceAccount:
          name: <service_account_installer_name>
        source:
          sourceType: Catalog
          catalog:
            packageName: <package_name>
            channels:
              - <channel_name>
            version: <version_or_version_range>
            upgradeConstraintPolicy: CatalogProvided

    where:

    spec.namespace

    Specifies the namespace where you want the bundle installed, such as pipelines or my-extension. Extensions are still cluster-scoped and might contain resources that are installed in different namespaces.

    spec.serviceAccount.name

    Specifies the name of the service account you created to install, update, and manage your extension.

    spec.source.catalog.channels

    Specifies channel names as an array, such as pipelines-1.14 or latest. This field is optional.

    spec.source.catalog.version

    Specifies the version or version range, such as 1.14.0, 1.14.x, or >=1.16, of the package you want to install or update. This field is optional.

    spec.source.catalog.upgradeConstraintPolicy

    Specifies the upgrade constraint policy. If unspecified, the default setting is CatalogProvided. The CatalogProvided setting only updates if the new version satisfies the upgrade constraints set by the package author. To force an update or rollback, set the field to SelfCertified. This field is optional.

    Example pipelines-operator.yaml CR
    apiVersion: olm.operatorframework.io/v1
    kind: ClusterExtension
    metadata:
      name: pipelines-operator
    spec:
      namespace: pipelines
      serviceAccount:
        name: pipelines-installer
      source:
        sourceType: Catalog
        catalog:
          packageName: openshift-pipelines-operator-rh
          version: "1.14.x"
  2. Apply the CR to the cluster by running the following command:

    $ oc apply -f pipeline-operator.yaml
    Example output
    clusterextension.olm.operatorframework.io/pipelines-operator created
Verification
  1. View the Operator or extension’s CR in the YAML format by running the following command:

    $ oc get clusterextension pipelines-operator -o yaml
    Example output
    apiVersion: v1
    items:
    - apiVersion: olm.operatorframework.io/v1
      kind: ClusterExtension
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"olm.operatorframework.io/v1","kind":"ClusterExtension","metadata":{"annotations":{},"name":"pipes"},"spec":{"namespace":"pipelines","serviceAccount":{"name":"pipelines-installer"},"source":{"catalog":{"packageName":"openshift-pipelines-operator-rh","version":"1.14.x"},"sourceType":"Catalog"}}}
        creationTimestamp: "2025-02-18T21:48:13Z"
        finalizers:
        - olm.operatorframework.io/cleanup-unpack-cache
        - olm.operatorframework.io/cleanup-contentmanager-cache
        generation: 1
        name: pipelines-operator
        resourceVersion: "72725"
        uid: e18b13fb-a96d-436f-be75-a9a0f2b07993
      spec:
        namespace: pipelines
        serviceAccount:
          name: pipelines-installer
        source:
          catalog:
            packageName: openshift-pipelines-operator-rh
            upgradeConstraintPolicy: CatalogProvided
            version: 1.14.x
          sourceType: Catalog
      status:
        conditions:
        - lastTransitionTime: "2025-02-18T21:48:13Z"
          message: ""
          observedGeneration: 1
          reason: Deprecated
          status: "False"
          type: Deprecated
        - lastTransitionTime: "2025-02-18T21:48:13Z"
          message: ""
          observedGeneration: 1
          reason: Deprecated
          status: "False"
          type: PackageDeprecated
        - lastTransitionTime: "2025-02-18T21:48:13Z"
          message: ""
          observedGeneration: 1
          reason: Deprecated
          status: "False"
          type: ChannelDeprecated
        - lastTransitionTime: "2025-02-18T21:48:13Z"
          message: ""
          observedGeneration: 1
          reason: Deprecated
          status: "False"
          type: BundleDeprecated
        - lastTransitionTime: "2025-02-18T21:48:16Z"
          message: Installed bundle registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:f7b19ce26be742c4aaa458d37bc5ad373b5b29b20aaa7d308349687d3cbd8838
            successfully
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: Installed
        - lastTransitionTime: "2025-02-18T21:48:16Z"
          message: desired state reached
          observedGeneration: 1
          reason: Succeeded
          status: "True"
          type: Progressing
        install:
          bundle:
            name: openshift-pipelines-operator-rh.v1.14.5
            version: 1.14.5
    kind: List
    metadata:
      resourceVersion: ""

    where:

    spec.channel

    Displays the channel defined in the CR of the extension.

    spec.version

    Displays the version or version range defined in the CR of the extension.

    status.conditions

    Displays information about the status and health of the extension.

    type: Deprecated

    Displays whether one or more of following are deprecated:

    type: PackageDeprecated

    Displays whether the resolved package is deprecated.

    type: ChannelDeprecated

    Displays whether the resolved channel is deprecated.

    type: BundleDeprecated

    Displays whether the resolved bundle is deprecated.

    The value of False in the status field indicates that the reason: Deprecated condition is not deprecated. The value of True in the status field indicates that the reason: Deprecated condition is deprecated.

    installedBundle.name

    Displays the name of the bundle installed.

    installedBundle.version

    Displays the version of the bundle installed.