olm-book

Operator Marketplace

On OpenShift clusters, the marketplace-operator makes off-cluster Quay Appregistry type catalogs available to OLM. It is installed by default with OpenShift.

Pulling Catalogs From Appregistry

The marketplace-operator can be told to pull a catalog from Appregistry by creating an OperatorSource:

apiVersion: operators.coreos.com/v1
kind: OperatorSource
metadata:
  name: my-operators
  namespace: openshift-marketplace
spec:
  type: appregistry
  endpoint: https://quay.io/cnr
  registryNamespace: my-operators
  displayName: "My Operators"
  publisher: "Me, Myself, and I"

The creation of an OperatorSource results in the creation of an OLM CatalogSource in the same namespace the marketplace-operator is running in. This CatalogSource will be populated with operators from the OperatorSource ready to be managed by OLM.

In versions of OpenShift > 4.2, all CatalogSources generated by the marketplace-operator in the openshift-marketplace namespace are available for use in all namespaces.

Configuration

The marketplace-operator is installed by default into the openshift-marketplace namespace along with three Red Hat provided OperatorSources; redhat-operators, certified-operators, and community-operators, which represent operators published by redhat, ISVs (Independent Software Vendors), and upstream community members respectively.

In versions of OpenShift > 4.2, The default behavior of the marketplace-operator ensures these OperatorSources always exist on a cluster, even if they are manually deleted.

You can manually configure which OperatorSources the marketplace-operator recreates by creating an OperatorHub resource:

apiVersion: config.openshift.io/v1
kind: OperatorHub
metadata:
  name: cluster
spec:
  sources:
  - name: "community-operators"
    disabled: true

Alternatively, to disable all default OperatorSources, you can use the disableAllDefaultSources attribute:

apiVersion: config.openshift.io/v1
kind: OperatorHub
metadata:
  name: cluster
spec:
  disableAllDefaultSources: true

Note: sources takes precedent over disableAllDefaultSources if it has entries defined.

Once an OperatorSource is disabled, the marketplace-operator will automatically delete it if present.

In OpenShift 4.1, recreation of the default OperatorSources is controlled by CVO (cluster-version-operator) and can be disabled by setting them as unmanaged resources:

$ cat <<EOF >version-patch.yaml
 - op: add
   path: /spec/overrides/-
   value:
     kind: OperatorSource
     name: community-operators
     namespace: openshift-marketplace
     unmanaged: true
EOF
$ kubectl patch clusterversion version --type json -p "$(cat version-patch.yaml)"
...

_Note: In OpenShift 4.1, default OperatorSources won’t be deleted automatically when disabled.