Skip to content

Getting Started with the SF Operator

  1. Prerequisites
  2. Installing the Operator
  3. Deinstallation the Operator
  4. Next steps

Prerequisites

In order to install the SF Operator on OpenShift, you will need:

  1. An OpenShift cluster (obviously). It is possible to use a MicroShift instance instead; in that case see the prerequisites and/or how to deploy MicroShift in the developer's documentation.
  2. OLM running on your cluster. For most flavors of OpenShift this is already the case.
  3. The community operators CatalogSource, to handle operator dependencies for SF-Operator. For most standard installations of OLM, this CatalogSource is already installed.
  4. A valid kubeconfig file, for a user with enough permissions to create a CatalogSource and a Subscription Custom Resources, on the olm and operators namespaces respectively.
  5. The kubectl utility, to apply and create new resources on the OpenShift cluster. It is also required to use restore functionality.

Installing the operator

Create the CatalogSource

The sf-operator is packaged for OLM and is distributed by a Catalog we maintain. Thus to deploy the Operator you need to add a new CatalogSource resource into the olm namespace.

Create the following CatalogSource resource; save it in a file named sf-catalogsource.yaml:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: sf-operator-catalog
  namespace: olm
spec:
  sourceType: grpc
  image: quay.io/software-factory/sf-operator-catalog:latest
  displayName: sf-operator
  publisher: softwarefactory-project.io
  updateStrategy:
    registryPoll:
      interval: 60m

Then create the resource on the cluster:

kubectl create -f sf-catalogsource.yaml

Once the Catalog is defined, we can tell OLM to install the sf-operator by applying a Subscription resource. Create sf-subscription.yaml with the following content:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: sf-operator-sub
  namespace: operators
spec:
  channel: preview
  name: sf-operator
  source: sf-operator-catalog
  sourceNamespace: olm

Then create the resource on the cluster:

kubectl create -f sf-subscription.yaml

After a few seconds you can ensure that the operator is running:

kubectl -n operators get deployment.apps/sf-operator-controller-manager
NAME                                                READY   UP-TO-DATE   AVAILABLE   AGE
pod/sf-operator-controller-manager-65cc95995c-bgt25   2/2     Running   0          3m49s

You can also confirm that the operator's Custom Resource Definitions (CRD) were installed properly:

kubectl get crd -o custom-columns=NAME:.metadata.name | grep softwarefactory-project.io
softwarefactories.sf.softwarefactory-project.io

Note that the SF-Operator OLM package depends on the following operators:

Congratulations, the SF Operator is now running on your cluster!

Deinstalling the operator

For further details on how to remove an operator, see OLM's upstream documentation.

Next steps

Your next step is to deploy a Zuul-based CI with the operator.