You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.md
+58-3
Original file line number
Diff line number
Diff line change
@@ -542,6 +542,14 @@ You can run the operator in a couple of ways. You can run it locally where the
542
542
operator runs on your development machine and talks to the cluster. Or it can
543
543
build images of your operator and run it directly in the cluster.
544
544
545
+
546
+
There are three ways to run the operator:
547
+
548
+
* Running the operator in the cluster
549
+
* Running locally outside the cluster
550
+
* Managed by the [Operator Lifecycle Manager (OLM)](https://sdk.operatorframework.io/docs/olm-integration/tutorial-bundle/#enabling-olm) in [bundle](https://sdk.operatorframework.io/docs/olm-integration/quickstart-bundle/) format
551
+
552
+
545
553
In this section we will:
546
554
547
555
* install the CRD
@@ -566,17 +574,17 @@ conveniently build your and push your operator's image to registry. In our
566
574
example, we are using `quay.io`, but any docker registry should work.
567
575
568
576
```
569
-
make docker-build docker-push IMG=quay.io/YOURUSER/memcached-quarkus-operator:0.0.1
577
+
make docker-build docker-push IMG=quay.io/YOURUSER/memcached-quarkus-operator:v0.0.1
570
578
```
571
579
572
580
This will build the docker image
573
-
`quay.io/YOURUSER/memcached-quarkus-operator:0.0.1` and push it to the registry.
581
+
`quay.io/YOURUSER/memcached-quarkus-operator:v0.0.1` and push it to the registry.
574
582
575
583
You can verify it is in your docker registry:
576
584
577
585
```
578
586
$ docker images | grep memcached
579
-
quay.io/YOURUSER/memcached-quarkus-operator 0.0.1 c84d2616bc1b 29 seconds ago 236MB
587
+
quay.io/YOURUSER/memcached-quarkus-operator v0.0.1 c84d2616bc1b 29 seconds ago 236MB
Bundle your operator, then build and push the bundle image. The [bundle](https://github.com/operator-framework/operator-registry/blob/v1.23.0/docs/design/operator-bundle.md#operator-bundle) target generates a bundle in the `bundle` directory containing manifests and metadata defining your operator. `bundle-build` and `bundle-push` build and push a bundle image defined by `bundle.Dockerfile`.
803
+
804
+
Before running below command export environment variables as shown below.
805
+
806
+
```
807
+
$ export USERNAME=<container-registry-username>
808
+
$ export VERSION=0.0.1
809
+
$ export IMG=docker.io/$USERNAME/memcached-operator:v$VERSION // location where your operator image is hosted
810
+
$ export BUNDLE_IMG=docker.io/$USERNAME/memcached-operator-bundle:v$VERSION // location where your bundle will be hosted
811
+
```
812
+
813
+
```
814
+
make bundle bundle-build bundle-push
815
+
```
816
+
817
+
Finally, run your bundle. If your bundle image is hosted in a registry that is private and/or has a custom CA, these [configuration steps](https://sdk.operatorframework.io/docs/olm-integration/cli-overview/#private-bundle-and-catalog-image-registries) must be completed.
818
+
819
+
820
+
```
821
+
operator-sdk run bundle <some-registry>/memcached-operator-bundle:v0.0.1
822
+
```
823
+
824
+
The result of the above command is as below:
825
+
826
+
```
827
+
INFO[0009] Successfully created registry pod: docker-io-013859989-memcached-quarkus-operator-bundle-v0-1-1
828
+
INFO[0009] Created CatalogSource: memcached-quarkus-operator-catalog
829
+
INFO[0009] OperatorGroup "operator-sdk-og" created
830
+
INFO[0009] Created Subscription: memcached-quarkus-operator-v0-1-1-sub
831
+
INFO[0013] Approved InstallPlan install-6n8vm for the Subscription: memcached-quarkus-operator-v0-1-1-sub
832
+
INFO[0013] Waiting for ClusterServiceVersion "default/memcached-quarkus-operator.v0.1.1" to reach 'Succeeded' phase
833
+
INFO[0013] Waiting for ClusterServiceVersion "default/memcached-quarkus-operator.v0.1.1" to appear
834
+
INFO[0020] Found ClusterServiceVersion "default/memcached-quarkus-operator.v0.1.1" phase: Pending
835
+
INFO[0021] Found ClusterServiceVersion "default/memcached-quarkus-operator.v0.1.1" phase: Installing
836
+
INFO[0051] Found ClusterServiceVersion "default/memcached-quarkus-operator.v0.1.1" phase: Succeeded
837
+
INFO[0051] OLM has successfully installed "memcached-quarkus-operator.v0.1.1"
838
+
```
839
+
840
+
Check out the [docs](https://sdk.operatorframework.io/docs/olm-integration/tutorial-bundle/) for a deep dive into operator-sdk's OLM integration.
0 commit comments