Describe how to test the cna operator using OLM
@@ -217,3 +217,94 @@ make cluster-clean
# delete the cluster
make cluster-down
```
+
+## Deploy Using OLM
+
+For more information on the [Operator Lifecycle
+Manager](https://github.com/operator-framework/operator-lifecycle-manager) and
+Cluster Service Versions checkout out ["Building a Cluster Service
+Version"](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md).
+
+**NOTE**
+
+Replace `<docker_org>` with your Docker organization.
+
+1) Build and push an operator-registry image.
+
+```shell
+cd deploy
+export DOCKER_ORG=<docker_org>
+docker build --no-cache -t docker.io/$DOCKER_ORG/cna-registry:example -f Dockerfile .
+docker push docker.io/$DOCKER_ORG/cna-registry:example
+```
+
+2) Create the cluster-network-addons-operator Namespace and OperatorGroup.
+[This](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md#operator-metadata)
+portion of OLM's CSV writing documentation goes into more detail about
+OperatorGroups.
+
+```shell
+kubectl create ns cluster-network-addons-operator
+
+cat <<EOF | kubectl create -f -
+apiVersion: operators.coreos.com/v1alpha2
+kind: OperatorGroup
+metadata:
+ name: cluster-network-addons-operator
+ namespace: cluster-network-addons-operator
+EOF
+```
+
+3) Using the `cna-registry` container image built in step 1,
+create a CatalogSource. This object tells OLM about the operator.
+
+```bash
+cat <<EOF | kubectl create -f -
+apiVersion: operators.coreos.com/v1alpha1
+kind: CatalogSource
+metadata:
+ name: cluster-network-addons
+ namespace: openshift-operator-lifecycle-manager
+spec:
+ sourceType: grpc
+ image: docker.io/$DOCKER_ORG/cna-registry:example
+ displayName: Cluster Network Addons
+ publisher: Red Hat
+EOF
+```
+
+4) Subscribe to the cluster-network-addons-operator.
+
+```shell
+cat <<EOF | kubectl create -f -
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ name: cluster-network-addons-operator-subscription
+ namespace: cluster-network-addons-operator
+spec:
+ channel: alpha
+ name: cluster-network-addons
+ source: cluster-network-addons
+ sourceNamespace: openshift-operator-lifecycle-manager
+ startingCSV: cluster-network-addons-operator.v0.0.0
+EOF
+```
+
+5) With the cluster-network-addons-operator ready and available, create a NetworkAddonsConfig.
+
+```shell
+cat <<EOF | kubectl create -f -
+apiVersion: networkaddonsoperator.network.kubevirt.io/v1alpha1
+kind: NetworkAddonsConfig
+metadata:
+ name: cluster
+spec:
+ imagePullPolicy: Always
+ kubeMacPool:
+ endPoolRange: FD:FF:FF:FF:FF:FF
+ startPoolRange: "02:00:00:00:00:00"
+ linuxBridge: {}
+ multus: {}
+ sriov: {}
+```
