Getting Started

Install OLM in a kubernetes cluster.


Installing OLM in your cluster

Install Released OLM

For installing release versions of OLM, for example version 0.15.1, you can use the following command:

export olm_release=0.15.1
kubectl apply -f${olm_release}/crds.yaml
kubectl apply -f${olm_release}/olm.yaml

Learn more about available releases here.

To deploy OLM locally on a minikube cluster for development work, use the run-local target in the Makefile.

git clone
cd operator-lifecycle-manager
make run-local

Verify Installation

You can verify your installation of OLM by first checking for all the necessary CRDs in the cluster:

$ kubectl get crd
NAME                                          CREATED AT           2019-10-21T18:15:27Z   2019-10-21T18:15:27Z             2019-10-21T18:15:27Z           2019-10-21T18:15:27Z            2019-10-21T18:15:27Z

And then inspecting the deployments of OLM and it’s related components:

$ kubectl get deploy -n olm
catalog-operator   1/1     1            1           5m52s
olm-operator       1/1     1            1           5m52s
packageserver      2/2     2            2           5m43s

Installing an Operator using OLM

When you install OLM, it comes packaged with a number of Operators developed by the community that you can install instantly. You can use the pacakagemanifest api to see the operators available for you to install in your cluster:

$ kubectl get packagemanifest -n olm
NAME                               CATALOG               AGE
cassandra-operator                 Community Operators   26m
etcd                               Community Operators   26m
postgres-operator                  Community Operators   26m
prometheus                         Community Operators   26m
wildfly                            Community Operators   26m

To install the etcd operator in the default namespace, first create an OperatorGroup for the default namespace:

$ cat operatorgroup.yaml
kind: OperatorGroup
  name: og-single
  namespace: default
  - default

$ kubectl apply -f operatorgroup.yaml created

Then create a subscription for the etcd operator:

$ cat subscription.yaml
kind: Subscription
  name: etcd
  namespace: default
  channel: singlenamespace-alpha
  installPlanApproval: Automatic
  name: etcd
  source: operatorhubio-catalog
  sourceNamespace: olm
  startingCSV: etcdoperator.v0.9.2

$ kubectl apply -f subscription.yaml created

This installs the v0.9.2 version of the etcd operator, and then upgrades to the latest version of the etcd operator in your cluster.

$ kubectl get sub -n default
NAME   PACKAGE   SOURCE                  CHANNEL
etcd   etcd      operatorhubio-catalog   singlenamespace-alpha

$ kubectl get csv -n default
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

$ kubectl get deployment -n default
etcd-operator   1/1     1            1           3m29s

To learn more about packaging your operator for OLM, installing/uninstalling an operator etc, visit the Core Tasks and the Advanced Tasks section of this site.