> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the Pulsar Operators using the Operator Lifecycle Manager

This document demonstrates how to install the Pulsar Operators using the [Operator Lifecycle Manager (OLM)](https://olm.operatorframework.io/), which is a part of the [Operator Framework](https://olm.operatorframework.io/). The OLM provides a declarative way to install, manage, and upgrade operators on a Kubernetes cluster. StreamNative develops and maintains the Pulsar Operators' packages on the [OperatorHub](https://operatorhub.io/).

## Prerequisites

* Prepare a Kubernetes cluster (v1.24 or above)
* Install [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl) (v1.24 or above), compatible with your cluster (+/- 1 minor release from your cluster).

## Install the Pulsar Operators

1. Install the OLM.
   The script automatically creates the `olm` namespace and the `operators` namespace.

   ```bash theme={null}
   curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.23.1/install.sh | bash -s v0.23.1
   ```

2. Install the Custom Resource Definitions (CRDs) and custom controllers for Pulsar, BookKeeper, and ZooKeeper. The controllers are deployed in the `operators` namespace by default.

   ```bash theme={null}
   kubectl create -f https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/olm-subscription.yaml
   ```

3. Verify that the Pulsar Operators are installed successfully.

   ```bash theme={null}
   kubectl get all -n operators
   ```

<Note title="Note">
  When you deploy the Pulsar Operators, the OLM first runs a Job in the `olm` namespace for each operator. You need to wait for the Jobs to finish before you can see the output.
</Note>

You should see the following output. The three custom controllers are running as Deployments, each having one Pod replica by default. The OLM exposes them internally through the `ClusterIP` service type, which means that they are reachable within the cluster.

```bash theme={null}
NAME                                                          READY   STATUS    RESTARTS   AGE
pod/bookkeeper-operator-controller-manager-788bc4fd7b-gsndx   2/2     Running   0          48m
pod/pulsar-operator-controller-manager-5b8d9785fc-47dcl       2/2     Running   0          48m
pod/zookeeper-operator-controller-manager-58999c8584-cpnf7    2/2     Running   0          48m

NAME                                                             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/bookkeeper-operator-controller-manager-metrics-service   ClusterIP   10.109.5.240    <none>        8443/TCP   48m
service/pulsar-operator-controller-manager-metrics-service       ClusterIP   10.99.44.182    <none>        8443/TCP   51m
service/zookeeper-operator-controller-manager-metrics-service    ClusterIP   10.101.118.19   <none>        8443/TCP   47m

NAME                                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/bookkeeper-operator-controller-manager   1/1     1            1           48m
deployment.apps/pulsar-operator-controller-manager       1/1     1            1           48m
deployment.apps/zookeeper-operator-controller-manager    1/1     1            1           48m

NAME                                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/bookkeeper-operator-controller-manager-788bc4fd7b   1         1         1       48m
replicaset.apps/pulsar-operator-controller-manager-5b8d9785fc       1         1         1       48m
replicaset.apps/zookeeper-operator-controller-manager-58999c8584    1         1         1       48m
```

4. View the created CRDs. These CRDs can be used to create CRs for Pulsar.

   ```bash theme={null}
   kubectl get crds | grep streamnative
   ```

   You should see the following output:

   ```bash theme={null}
   NAME                                            CREATED AT
   bookkeeperclusters.bookkeeper.streamnative.io   2023-03-02T08:52:52Z
   pulsarbrokers.pulsar.streamnative.io            2023-03-02T08:52:52Z
   pulsarproxies.pulsar.streamnative.io            2023-03-02T08:52:52Z
   zookeeperclusters.zookeeper.streamnative.io     2023-03-02T08:52:53Z
   ```

5. View the [ClusterServiceVersion (CSV)](https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/) of these operators.

   ```bash theme={null}
   kubectl get csv -n operators
   ```

   You should see the following output:

   ```bash theme={null}
   NAME                          DISPLAY               VERSION   REPLACES                      PHASE
   bookkeeper-operator.v0.14.1   BookKeeper Operator   0.14.1    bookkeeper-operator.v0.12.4   Succeeded
   pulsar-operator.v0.14.1       Pulsar Operator       0.14.1    pulsar-operator.v0.12.4       Succeeded
   zookeeper-operator.v0.14.1    ZooKeeper Operator    0.14.1    zookeeper-operator.v0.12.4    Succeeded
   ```

   With the Pulsar Operators installed, you can use the controllers and the CRDs to deploy a Pulsar cluster.

## Related topics

* [Install the Pulsar Operators using the Helm chart](/tools/operator/quickstart-guides/pulsar-operator-install-helm-chart).
* [Deploy a Pulsar cluster using the Pulsar Operators](/tools/operator/how-to-guides/pulsar-operator-deploy-pulsar).
