Skip to content

Commit 178d96a

Browse files
authored
Update OLM instructions (#520)
Signed-off-by: Pavol Loffay <[email protected]>
1 parent e788064 commit 178d96a

File tree

2 files changed

+19
-42
lines changed

2 files changed

+19
-42
lines changed

CONTRIBUTING.md

+16-42
Original file line numberDiff line numberDiff line change
@@ -126,59 +126,33 @@ For production environments, it is recommended to use the [Operator Lifecycle Ma
126126

127127
### Setup OLM
128128

129-
When using Kubernetes, install OLM following the [official instructions](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/install/install.md). At the moment of this writing, it involves the following:
129+
When using Kubernetes, install OLM following the [official instructions](https://sdk.operatorframework.io/docs/olm-integration/). At the moment of this writing, it involves the following:
130130

131131
```bash
132-
kubectl create -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/crds.yaml
133-
kubectl create -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml
134-
kubectl wait --for=condition=available deployment packageserver -n olm
135-
kubectl wait --for=condition=available deployment olm-operator -n olm
136-
kubectl wait --for=condition=available deployment catalog-operator -n olm
132+
operator-sdk olm install
137133
```
138134

139-
When using OpenShift, OLM is already installed.
135+
When using OpenShift, the OLM is already installed.
140136

141137
### Create the bundle and related images
142138

143-
The following commands will generate a bundle under `bundle/` and build an image with its contents. It will then generate and publish an index image with the [Operator Package Manager (OPM)](https://github.com/operator-framework/operator-registry/blob/master/docs/design/opm-tooling.md#opm)
139+
The following commands will generate a bundle under `bundle/`, build an image with its contents, build and publish the operator image.
144140

145141
```bash
146-
export VERSION=x.y.z
147-
make set-image-controller bundle bundle-build
148-
podman push quay.io/${USER}/opentelemetry-operator-bundle:${VERSION}
149-
opm index add --bundles quay.io/${USER}/opentelemetry-operator-bundle:${VERSION} --tag quay.io/${USER}/opentelemetry-operator-index:${VERSION}
150-
podman push quay.io/${USER}/opentelemetry-operator-index:${VERSION}
142+
BUNDLE_IMG=docker.io/${USER}/opentelemetry-operator-bundle:latest IMG=docker.io/${USER}/opentelemetry-operator:latest make bundle container container-push bundle-build bundle-push
151143
```
152144

153145
### Install the operator
154146

155-
To install our operator, create a `CatalogSource` for our index image, wait for OLM to synchronize and finally create a `Subscription`. Make sure to replace `${USER}` with your username and `${VERSION}` with the version used in the previous step. The namespace for both should be `operators` on Kubernetes, while `openshift-operators` should be used for OpenShift.
156-
157-
```yaml
158-
kubectl apply -f - <<EOF
159-
apiVersion: operators.coreos.com/v1alpha1
160-
kind: CatalogSource
161-
metadata:
162-
name: opentelemetry-operator-manifests
163-
namespace: operators
164-
spec:
165-
sourceType: grpc
166-
image: quay.io/${USER}/opentelemetry-operator-index:${VERSION}
167-
EOF
168-
kubectl wait --for=condition=ready pod -l olm.catalogSource=opentelemetry-operator-manifests -n operators
169-
170-
kubectl apply -f - <<EOF
171-
apiVersion: operators.coreos.com/v1alpha1
172-
kind: Subscription
173-
metadata:
174-
name: opentelemetry-operator-subscription
175-
namespace: operators
176-
spec:
177-
channel: "alpha"
178-
installPlanApproval: Automatic
179-
name: opentelemetry-operator
180-
source: opentelemetry-operator-manifests
181-
sourceNamespace: operators
182-
EOF
183-
kubectl wait --for=condition=available deployment opentelemetry-operator-controller-manager -n operators
147+
```bash
148+
operator-sdk run bundle docker.io/${USER}/opentelemetry-operator-bundle:latest
149+
```
150+
151+
### Uninstall the operator
152+
153+
The operator can be uninstalled by deleting `subscriptions.operators.coreos.com` and `clusterserviceversion.operators.coreos.com` objects from the current namespace.
154+
155+
```bash
156+
kubectl delete clusterserviceversion.operators.coreos.com --all
157+
kubectl delete subscriptions.operators.coreos.com --all
184158
```

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,7 @@ bundle: kustomize operator-sdk manifests set-image-controller
228228
bundle-build:
229229
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
230230

231+
bundle-push:
232+
docker push $(BUNDLE_IMG)
233+
231234
tools: ginkgo kustomize controller-gen operator-sdk

0 commit comments

Comments
 (0)