// Module included in the following assemblies:
//
// assembly-installing.adoc

[id='installing-using-custom-operator-source-{context}']
= Installing {ProductName} using Operator Marketplace

If the version of {ProductName} you want to install is not available in the link:https://www.operatorhub.io[Operator
Hub^], you can install a custom `OperatorSource` for {ProductName} following these steps.

.Prerequisites

* link:https://github.com/operator-framework/operator-lifecycle-manager[Operator Lifecycle Manager] must be installed.
* link:https://github.com/operator-framework/operator-marketplace[Operator Marketplace] must be installed.

.Procedure 

. Create an `OperatorSource`:
+
[options="nowrap",subs="+quotes,attributes"]
----
cat <<EOF | {cmdcli} apply -f -
apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
  name: {OperatorSourceName}
  namespace: {OperatorMarketplaceNamespace}
spec:
  type: appregistry
  endpoint: https://quay.io/cnr
  registryNamespace: enmasse
  displayName: "EnMasse Operators"
  publisher: "EnMasse"
EOF
----

. Create a `CatalogSourceConfig` to enable the operator on your {KubePlatform} cluster:
+
[options="nowrap",subs="+quotes,attributes"]
----
cat <<EOF | {cmdcli} apply -f -
apiVersion: operators.coreos.com/v1
kind: CatalogSourceConfig
metadata:
  name: {OperatorSourceConfigName}
  namespace: {OperatorMarketplaceNamespace}
spec:
  csDisplayName: EnMasse Operators
  csPublisher: EnMasse
  packages: enmasse
  source: enmasse-operators
  targetNamespace: {OperatorMarketplaceNamespace}
EOF
----

. Create a `Subscription` to install the operator and receive updates:
+
[options="nowrap",subs="+quotes,attributes"]
----
cat <<EOF | {cmdcli} apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: {OperatorName}
  namespace: _{ProductNamespace}_
spec:
  channel: alpha
  name: {OperatorName}
  source: {OperatorSourceConfigName}
  sourceNamespace: {OperatorMarketplaceNamespace}
EOF
----
