|
| 1 | +// Module included in the following assembly: |
| 2 | +// |
| 3 | +// * configuring-an-openshift-cluster-by-deploying-an-application-with-cluster-configurations.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="gitops-installing-olm-operators-using-gitops_{context}"] |
| 7 | += Installing OLM Operators using {gitops-title} |
| 8 | + |
| 9 | +{gitops-title} with cluster configurations manages specific cluster-scoped resources and takes care of installing cluster Operators or any namespace-scoped OLM Operators. |
| 10 | + |
| 11 | +Consider a case where as a cluster administrator, you have to install an OLM Operator such as Tekton. You use the {product-title} web console to manually install a Tekton Operator or the OpenShift CLI to manually install a Tekton subscription and Tekton Operator group on your cluster. |
| 12 | + |
| 13 | +{gitops-title} places your Kubernetes resources in your Git repository. As a cluster administrator, use {gitops-title} to manage and automate the installation of other OLM Operators without any manual procedures. For example, after you place the Tekton subscription in your Git repository by using {gitops-title}, the {gitops-title} automatically takes this Tekton subscription from your Git repository and installs the Tekton Operator on your cluster. |
| 14 | + |
| 15 | +== Installing cluster-scoped Operators |
| 16 | + |
| 17 | +Operator Lifecycle Manager (OLM) uses a default `global-operators` Operator group in the `openshift-operators` namespace for cluster-scoped Operators. Hence you do not have to manage the `OperatorGroup` resource in your Gitops repository. However, for namespace-scoped Operators, you must manage the `OperatorGroup` resource in that namespace. |
| 18 | + |
| 19 | +To install cluster-scoped Operators, create and place the `Subscription` resource of the required Operator in your Git repository. |
| 20 | + |
| 21 | +.Example: Grafana Operator subscription |
| 22 | + |
| 23 | +[source,yaml] |
| 24 | +---- |
| 25 | +apiVersion: operators.coreos.com/v1alpha1 |
| 26 | +kind: Subscription |
| 27 | +metadata: |
| 28 | + name: grafana |
| 29 | +spec: |
| 30 | + channel: v4 |
| 31 | + installPlanApproval: Automatic |
| 32 | + name: grafana-operator |
| 33 | + source: redhat-operators |
| 34 | + sourceNamespace: openshift-marketplace |
| 35 | +---- |
| 36 | + |
| 37 | +== Installing namepace-scoped Operators |
| 38 | + |
| 39 | +To install namespace-scoped Operators, create and place the `Subscription` and `OperatorGroup` resources of the required Operator in your Git repository. |
| 40 | + |
| 41 | +.Example: Ansible Automation Platform Resource Operator |
| 42 | + |
| 43 | +[source,yaml] |
| 44 | +---- |
| 45 | +... |
| 46 | +apiVersion: v1 |
| 47 | +kind: Namespace |
| 48 | +metadata: |
| 49 | + labels: |
| 50 | + openshift.io/cluster-monitoring: "true" |
| 51 | + name: ansible-automation-platform |
| 52 | +... |
| 53 | +apiVersion: operators.coreos.com/v1 |
| 54 | +kind: OperatorGroup |
| 55 | +metadata: |
| 56 | + name: ansible-automation-platform-operator |
| 57 | + namespace: ansible-automation-platform |
| 58 | +spec: |
| 59 | + targetNamespaces: |
| 60 | + - ansible-automation-platform |
| 61 | +... |
| 62 | +apiVersion: operators.coreos.com/v1alpha1 |
| 63 | +kind: Subscription |
| 64 | +metadata: |
| 65 | + name: ansible-automation-platform |
| 66 | + namespace: ansible-automation-platform |
| 67 | +spec: |
| 68 | + channel: patch-me |
| 69 | + installPlanApproval: Automatic |
| 70 | + name: ansible-automation-platform-operator |
| 71 | + source: redhat-operators |
| 72 | + sourceNamespace: openshift-marketplace |
| 73 | +... |
| 74 | +---- |
| 75 | + |
| 76 | +[IMPORTANT] |
| 77 | +==== |
| 78 | +When deploying multiple Operators using {gitops-title}, you must create only a single Operator group in the corresponding namespace. If more than one Operator group exists in a single namespace, any CSV created in that namespace transition to a `failure` state with the `TooManyOperatorGroups` reason. After the number of Operator groups in their corresponding namespaces reaches one, all the previous `failure` state CSVs transition to `pending` state. You must manually approve the pending install plan to complete the Operator installation. |
| 79 | +==== |
| 80 | + |
0 commit comments