5.2.3. Installing 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. For more information, see Supported extensions.
For OpenShift Container Platform 4.21, 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
Create a CR, similar to the following example:
apiVersion: olm.operatorframework.io/v1 kind: ClusterExtension metadata: name: <clusterextension_name> spec: namespace: <installed_namespace>1 serviceAccount: name: <service_account_installer_name>2 source: sourceType: Catalog catalog: packageName: <package_name> channels: - <channel_name>3 version: <version_or_version_range>4 upgradeConstraintPolicy: CatalogProvided5 - 1
- Specifies the namespace where you want the bundle installed, such as
pipelinesormy-extension. Extensions are still cluster-scoped and might contain resources that are installed in different namespaces. - 2
- Specifies the name of the service account you created to install, update, and manage your extension.
- 3
- Optional: Specifies channel names as an array, such as
pipelines-1.14orlatest. - 4
- Optional: 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. For more information, see "Example custom resources (CRs) that specify a target version" and "Support for version ranges". - 5
- Optional: Specifies the upgrade constraint policy. If unspecified, the default setting is
CatalogProvided. TheCatalogProvidedsetting only updates if the new version satisfies the upgrade constraints set by the package author. To force an update or rollback, set the field toSelfCertified. For more information, see "Forcing an update or rollback".
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"
Apply the CR to the cluster by running the following command:
$ oc apply -f pipeline-operator.yamlExample output
clusterextension.olm.operatorframework.io/pipelines-operator created
Verification
View the Operator or extension’s CR in the YAML format by running the following command:
$ oc get clusterextension pipelines-operator -o yaml예 5.11. 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: DeprecatedDisplays 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
Falsein thestatusfield indicates that thereason: Deprecatedcondition is not deprecated. The value ofTruein thestatusfield indicates that thereason: Deprecatedcondition is deprecated.installedBundle.name- Displays the name of the bundle installed.
installedBundle.version- Displays the version of the bundle installed.