Installing Operators in your namespace
If a cluster administrator has delegated Operator installation permissions to your account, you can install and subscribe an Operator to your namespace in a self-service manner.
Prerequisites
- A cluster administrator must add certain permissions to your OpenShift Container Platform user account to allow self-service Operator installation to a namespace.
About Operator installation from the software catalog
The software catalog in OpenShift Container Platform is the interface for discovering Operators that Operator Lifecycle Manager (OLM) installs and manages on your cluster. You can choose installation settings such as install mode, namespace, and approval strategy during subscription.
As a user with the proper permissions, you can install an Operator from the software catalog by using the OpenShift Container Platform web console or CLI.
During installation, you must determine the following initial settings for the Operator:
Installation Mode:: Choose a specific namespace in which to install the Operator.
- Update Channel
- If an Operator is available through multiple channels, you can choose which channel you want to subscribe to. For example, to deploy from the stable channel, if available, select it from the list.
- Approval Strategy
- You can choose automatic or manual updates. If you choose automatic updates for an installed Operator, when a new version of that Operator is available in the selected channel, Operator Lifecycle Manager (OLM) automatically upgrades the running instance of your Operator without human intervention. If you select manual updates, when a newer version of an Operator is available, OLM creates an update request. As a cluster administrator, you must then manually approve that update request to have the Operator updated to the new version.
Additional resources
Install from the software catalog by using the web console
To install and subscribe to an Operator from the software catalog, you can use the OpenShift Container Platform web console. The console guides you through selecting an install mode, namespace, and approval strategy.
Prerequisites
- Access to an OpenShift Container Platform cluster using an account with
cluster-adminpermissions. - Access to an OpenShift Container Platform cluster using an account with Operator installation permissions.
Procedure
-
Navigate in the web console to the Ecosystem → Software Catalog page.
-
Scroll or type a keyword into the Filter by keyword box to find the Operator you want. For example, type
advancedto find the Advanced Cluster Management for Kubernetes Operator. You can also filter options by Infrastructure Features. For example, select Disconnected if you want to see Operators that work in disconnected environments, also known as restricted network environments. -
Select the Operator to display additional information.
noteChoosing a Community Operator warns that Red Hat does not certify Community Operators; you must acknowledge the warning before continuing.
-
Read the information about the Operator and click Install.
-
On the Install Operator page, configure your Operator installation:
-
If you want to install a specific version of an Operator, select an Update channel and Version from the lists. You can browse the various versions of an Operator across any channels it might have, view the metadata for that channel and version, and select the exact version you want to install.
noteThe version selection defaults to the latest version for the channel selected. If the latest version for the channel is selected, the Automatic approval strategy is enabled by default. Otherwise, Manual approval is required when not installing the latest version for the selected channel.
Installing an Operator with Manual approval causes all Operators installed within the namespace to function with the Manual approval strategy and all Operators are updated together. If you want to update Operators independently, install Operators into separate namespaces.
-
Confirm the installation mode for the Operator:
- All namespaces on the cluster (default) installs the Operator in the default
openshift-operatorsnamespace to watch and be made available to all namespaces in the cluster. This option is not always available. - A specific namespace on the cluster allows you to choose a specific, single namespace in which to install the Operator. The Operator will only watch and be made available for use in this single namespace.
- All namespaces on the cluster (default) installs the Operator in the default
-
Choose a specific, single namespace in which to install the Operator. The Operator will only watch and be made available for use in this single namespace.
-
For clusters on cloud providers with token authentication enabled:
- If the cluster uses AWS Security Token Service (STS Mode in the web console), enter the Amazon Resource Name (ARN) of the AWS IAM role of your service account in the role ARN field. To create the role’s ARN, follow the procedure described in Preparing AWS account.
- If the cluster uses Microsoft Entra Workload ID (Workload Identity / Federated Identity Mode in the web console), add the client ID, tenant ID, and subscription ID in the appropriate fields.
- If the cluster uses Google Cloud Platform Workload Identity (GCP Workload Identity / Federated Identity Mode in the web console), add the project number, pool ID, provider ID, and service account email in the appropriate fields.
-
-
For Update approval, select either the Automatic or Manual approval strategy.
warningIf the web console shows that the cluster uses AWS STS, Microsoft Entra Workload ID, or GCP Workload Identity, you must set Update approval to Manual.
Subscriptions with automatic approvals for updates are not recommended because there might be permission changes to make before updating. Subscriptions with manual approvals for updates ensure that administrators have the opportunity to verify the permissions of the later version, take any necessary steps, and then update.
- Click Install to make the Operator available to the selected namespaces on this OpenShift Container Platform cluster:
-
If you selected a Manual approval strategy, the upgrade status of the subscription remains Upgrading until you review and approve the install plan. After approving on the Install Plan page, the subscription upgrade status moves to Up to date.
-
If you selected an Automatic approval strategy, the upgrade status should resolve to Up to date without intervention.
Verification
-
After the upgrade status of the subscription is Up to date, select Ecosystem → Installed Operators to verify that the cluster service version (CSV) of the installed Operator eventually shows up. The Status should eventually resolve to Succeeded in the relevant namespace.
noteFor the All namespaces... installation mode, the status resolves to Succeeded in the
openshift-operatorsnamespace, but the status is Copied if you check in other namespaces.If it does not:
- Check the logs in any pods in the
openshift-operatorsproject (or other relevant namespace if A specific namespace... installation mode was selected) on the Workloads → Pods page that are reporting issues to troubleshoot further.
- Check the logs in any pods in the
-
When the Operator is installed, the metadata indicates which channel and version are installed.
noteThe Channel and Version dropdown menus are still available for viewing other version metadata in this catalog context.
Install from the software catalog by using the CLI
To install an Operator from the software catalog without using the web console, you can create or update a Subscription object by using the oc command in OpenShift Container Platform.
For SingleNamespace install mode, you must also ensure an appropriate Operator group exists in the related namespace. An Operator group, defined by an OperatorGroup object, selects target namespaces in which to generate required RBAC access for all Operators in the same namespace as the Operator group.
In most cases, the web console method of this procedure is preferred because it automates tasks in the background, such as handling the creation of OperatorGroup and Subscription objects automatically when choosing SingleNamespace mode.
Prerequisites
- Access to your OpenShift Container Platform cluster using an account with Operator installation permissions.
- You have installed the OpenShift CLI (
oc).
Procedure
-
View the list of Operators available to the cluster from the software catalog:
$ oc get packagemanifests -n openshift-marketplaceExample outputNAME CATALOG AGE3scale-operator Red Hat Operators 91madvanced-cluster-management Red Hat Operators 91mamq7-cert-manager Red Hat Operators 91m# ...couchbase-enterprise-certified Certified Operators 91mcrunchy-postgres-operator Certified Operators 91mmongodb-enterprise Certified Operators 91m# ...etcd Community Operators 91mjaeger Community Operators 91mkubefed Community Operators 91m# ...Note the catalog for your desired Operator.
-
Inspect your desired Operator to verify its supported install modes and available channels:
$ oc describe packagemanifests <operator_name> -n openshift-marketplaceExample output# ...Kind: PackageManifest# ...Install Modes:Supported: trueType: OwnNamespaceSupported: trueType: SingleNamespaceSupported: falseType: MultiNamespaceSupported: trueType: AllNamespaces# ...Entries:Name: example-operator.v3.7.11Version: 3.7.11Name: example-operator.v3.7.10Version: 3.7.10Name: stable-3.7# ...Entries:Name: example-operator.v3.8.5Version: 3.8.5Name: example-operator.v3.8.4Version: 3.8.4Name: stable-3.8Default Channel: stable-3.8In the example output,
Install Modesindicates which install modes are supported;Nameshows example channel names; andDefault Channelis the channel selected by default if one is not specified.tipYou can print an Operator’s version and channel information in YAML format by running the following command:
$ oc get packagemanifests <operator_name> -n <catalog_namespace> -o yaml -
If more than one catalog is installed in a namespace, run the following command to look up the available versions and channels of an Operator from a specific catalog:
$ oc get packagemanifest \--selector=catalog=<catalogsource_name> \--field-selector metadata.name=<operator_name> \-n <catalog_namespace> -o yamlwarningIf you do not specify the Operator’s catalog, running the
oc get packagemanifestandoc describe packagemanifestcommands might return a package from an unexpected catalog if the following conditions are met:- Multiple catalogs are installed in the same namespace.
- The catalogs contain the same Operators or Operators with the same name.
-
If the Operator you intend to install supports the
AllNamespacesinstall mode, and you choose to use this mode, skip this step, because theopenshift-operatorsnamespace already has an appropriate Operator group in place by default, calledglobal-operators. If the Operator you intend to install supports theSingleNamespaceinstall mode, and you choose to use this mode, you must ensure an appropriate Operator group exists in the related namespace. If one does not exist, you can create create one by following these steps:warningYou can only have one Operator group per namespace. For more information, see "Operator groups".
-
Create an
OperatorGroupobject YAML file, for exampleoperatorgroup.yaml, forSingleNamespaceinstall mode:Example OperatorGroup object for SingleNamespace install modeapiVersion: operators.coreos.com/v1kind: OperatorGroupmetadata:name: <operatorgroup_name>namespace: <namespace>spec:targetNamespaces:- <namespace>For
SingleNamespaceinstall mode, use the same<namespace>value for both themetadata.namespaceandspec.targetNamespacesfields. -
Create the
OperatorGroupobject:$ oc apply -f operatorgroup.yaml
-
-
Create a
Subscriptionobject to subscribe a namespace to an Operator:-
Create a YAML file for the
Subscriptionobject, for examplesubscription.yaml:noteIf you want to subscribe to a specific version of an Operator, set the
startingCSVfield to the desired version and set theinstallPlanApprovalfield toManualto prevent the Operator from automatically upgrading if a later version exists in the catalog. For details, see the following "ExampleSubscriptionobject with a specific starting Operator version".Example Subscription objectapiVersion: operators.coreos.com/v1alpha1kind: Subscriptionmetadata:name: <subscription_name>namespace: <namespace_per_install_mode>spec:channel: <channel_name>name: <operator_name>source: <catalog_name>sourceNamespace: <catalog_source_namespace>config:env:- name: ARGSvalue: "-v=10"envFrom:- secretRef:name: license-secretvolumes:- name: <volume_name>configMap:name: <configmap_name>volumeMounts:- mountPath: <directory_name>name: <volume_name>tolerations:- operator: "Exists"resources:requests:memory: "64Mi"cpu: "250m"limits:memory: "128Mi"cpu: "500m"nodeSelector:foo: barwhere:
<namespace_per_install_mode>- Specifies the namespace for your chosen install mode. For default
AllNamespacesinstall mode usage, specify theopenshift-operatorsnamespace. Alternatively, you can specify a custom global namespace, if you have created one. ForSingleNamespaceinstall mode usage, specify the relevant single namespace. <channel_name>- Specifies the name of the channel to subscribe to.
<operator_name>- Specifies the name of the Operator to subscribe to.
<catalog_name>- Specifies the name of the catalog source that provides the Operator.
<catalog_source_namespace>- Specifies the namespace of the catalog source. Use
openshift-marketplacefor the default software catalog sources. config.env- Specifies a list of environment variables that must exist in all containers in the pod created by OLM.
config.envFrom- Specifies a list of sources to populate environment variables in the container.
config.volumes- Specifies a list of volumes that must exist on the pod created by OLM.
config.volumeMounts- Specifies a list of volume mounts that must exist in all containers in the pod created by OLM. If a
volumeMountreferences avolumethat does not exist, OLM fails to deploy the Operator. config.tolerations- Specifies a list of tolerations for the pod created by OLM.
config.resources- Specifies resource constraints for all the containers in the pod created by OLM.
config.nodeSelector- Specifies a
NodeSelectorfor the pod created by OLM.
Example Subscription object with a specific starting Operator versionapiVersion: operators.coreos.com/v1alpha1kind: Subscriptionmetadata:name: example-operatornamespace: example-operatorspec:channel: stable-3.7installPlanApproval: Manualname: example-operatorsource: custom-operatorssourceNamespace: openshift-marketplacestartingCSV: example-operator.v3.7.10where:
installPlanApproval:: Specifies the approval strategy. Set toManualin case your specified version is superseded by a later version in the catalog. This plan prevents an automatic upgrade to a later version and requires manual approval before the starting CSV can complete the installation.startingCSV:: Specifies a specific version of an Operator CSV. -
For clusters on cloud providers with token authentication enabled, such as Amazon Web Services (AWS) Security Token Service (STS), Microsoft Entra Workload ID, or Google Cloud Platform Workload Identity, configure your
Subscriptionobject by following these steps:-
Ensure the
Subscriptionobject is set to manual update approvals:Example Subscription object with manual update approvalskind: Subscription# ...spec:installPlanApproval: ManualSet the
spec.installPlanApprovalparameter toManual. Subscriptions with manual approvals for updates ensure that administrators have the opportunity to verify the permissions of the later version, take any necessary steps, and then update. Subscriptions with automatic approvals for updates are not recommended because there might be permission changes to make before updating. -
Include the relevant cloud provider-specific fields in the
Subscriptionobject’sconfigsection: If the cluster is in AWS STS mode, include the following fields:Example Subscription object with AWS STS variableskind: Subscription# ...spec:config:env:- name: ROLEARNvalue: "<role_arn>"-
ROLEARNis the Amazon Resource Name (ARN) of the role that the Operator assumes. If the cluster is in Workload ID mode, include the following fields:Example Subscription object with Workload ID variableskind: Subscription# ...spec:config:env:- name: CLIENTIDvalue: "<client_id>"- name: TENANTIDvalue: "<tenant_id>"- name: SUBSCRIPTIONIDvalue: "<subscription_id>"where:
<client_id>- Specifies the client ID.
<tenant_id>- Specifies the tenant ID.
<subscription_id>- Specifies the subscription ID. If the cluster is in GCP Workload Identity mode, include the following fields:
Example Subscription object with GCP Workload Identity variableskind: Subscription# ...spec:config:env:- name: AUDIENCEvalue: "<audience_url>"- name: SERVICE_ACCOUNT_EMAILvalue: "<service_account_email>"where:
<audience_url>:: Created in Google Cloud by the administrator when they set up GCP Workload Identity, theAUDIENCEvalue must be a preformatted URL in the following format://iam.googleapis.com/projects/<project_number>/locations/global/workloadIdentityPools/<pool_id>/providers/<provider_id><service_account_email>- Specifies a Google Cloud service account email that is impersonated during Operator operation, for example:
<service_account_name>@<project_id>.iam.gserviceaccount.com
-
-
-
Create the
Subscriptionobject by running the following command:$ oc apply -f subscription.yaml
-
-
If you set the
installPlanApprovalfield toManual, manually approve the pending install plan to complete the Operator installation. For more information, see "Manually approving a pending Operator update".
Verification
At this point, OLM is now aware of the selected Operator. A cluster service version (CSV) for the Operator should appear in the target namespace, and APIs provided by the Operator should be available for creation.
- Check the status of the
Subscriptionobject for your installed Operator by running the following command:$ oc describe subscription <subscription_name> -n <namespace> - If you created an Operator group for
SingleNamespaceinstall mode, check the status of theOperatorGroupobject by running the following command:$ oc describe operatorgroup <operatorgroup_name> -n <namespace>
Additional resources
Additional resources