OLM Integration Bundle Quickstart
This document succinctly walks through getting an Operator OLM-ready with bundles, and glosses over explanations of certain steps for brevity. The following documents contain more detail on these steps:
- All operator-framework manifest commands supported by the SDK: .
- Generating operator-framework manifests: generation overview.
If you are working with package manifests, see the once you have completed the Setup section below.
Important: this guide assumes your project was scaffolded with . These features are unavailable to projects of version 2
or less; this information can be found by inspecting your PROJECT
file’s version
value.
Let’s first walk through creating an Operator for memcached
, a distributed key-value store.
Follow one of the user guides to develop the memcached-operator in either Go, , or Helm, depending on which Operator type you are interested in. This guide assumes memcached-operator is on version 0.0.1
, which is set in the Makefile
variable VERSION
.
Ensure OLM is enabled on your cluster before following this guide. has several subcommands that can install, uninstall, and check the status of particular OLM versions in a cluster.
You can check if OLM is already installed by running the following command, which will detect the installed OLM version automatically (0.15.1 in this example):
All resources listed should have status Installed
.
If OLM is not already installed, go ahead and install the latest version:
INFO[0000] Fetching CRDs for version "latest"
INFO[0001] Fetching resources for version "latest"
INFO[0007] Creating CRDs and resources
INFO[0007] Creating CustomResourceDefinition "clusterserviceversions.operators.coreos.com"
INFO[0007] Creating CustomResourceDefinition "installplans.operators.coreos.com"
INFO[0007] Creating CustomResourceDefinition "subscriptions.operators.coreos.com"
...
NAME NAMESPACE KIND STATUS
installplans.operators.coreos.com CustomResourceDefinition Installed
subscriptions.operators.coreos.com CustomResourceDefinition Installed
...
Note: By default, olm status
and olm uninstall
auto-detect the OLM version installed in your cluster. This can fail if the installation is broken in some way, so the version of OLM can be overridden using the --version
flag provided with these commands.
If working with package manifests, see the package manifests quickstart.
We will now create bundle manifests by running make bundle
in the root of the memcached-operator project.
At this point in development we’ve generated all files necessary to build the memcached-operator bundle. Now we’re ready to test and deploy the Operator with OLM.
Before proceeding, make sure you’ve onto your cluster.
First, we need to build our bundle. To build a memcached-operator bundle, run:
$ make bundle-build BUNDLE_IMG=<some-registry>/memcached-operator-bundle:v0.0.1
$ make docker-push IMG=<some-registry>/memcached-operator-bundle:v0.0.1
Now that the bundle image is present in a registry, operator-sdk run bundle can create a pod to serve that bundle to OLM via a , along with other OLM objects, ephemerally.
OLM and Operator Registry consumes Operator bundles via an index image, which are composed of one or more bundles. To build a memcached-operator bundle for version v0.0.1, run:
$ make docker-push IMG=<some-registry>/memcached-operator-bundle:v0.0.1
Although we’ve validated on-disk manifests and metadata, we also must make sure the bundle itself is valid: