Skip to content

Commit 80a1ffe

Browse files
committed
Add run bundle-upgrade
1 parent 3f3d371 commit 80a1ffe

11 files changed

+85
-78
lines changed

modules/osdk-building-bundle-image.adoc

Lines changed: 0 additions & 65 deletions
This file was deleted.

modules/osdk-bundle-deploy-olm.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
// * operators/operator_sdk/golang/osdk-golang-tutorial.adoc
44
// * operators/operator_sdk/ansible/osdk-ansible-tutorial.adoc
55
// * operators/operator_sdk/helm/osdk-helm-tutorial.adoc
6+
// * operators/operator_sdk/osdk-working-bundle-images.adoc
67

78
ifeval::["{context}" == "osdk-golang-tutorial"]
89
:golang:
910
endif::[]
1011

1112
[id="osdk-bundle-deploy-olm_{context}"]
12-
= Bundling and deploying with OLM
13+
= Bundling an Operator and deploying on Operator Lifecycle Manager
1314

1415
Operator Lifecycle Manager (OLM) helps you to install, update, and generally manage the lifecycle of Operators and their associated services on a Kubernetes cluster. OLM is installed by default on {product-title} and runs as a Kubernetes extension so that you can use the web console and the OpenShift CLI (`oc`) for all Operator lifecycle management functions without any additional tools.
1516

16-
This example walks through getting an Operator ready for OLM that uses the Bundle Format, the default packaging format for Operator SDK and OLM.
17+
The Operator Bundle Format is the default packaging method for Operator SDK and OLM. You can get your Operator ready for OLM by building, pushing, validating, and running a bundle image on OLM with the Operator SDK.
1718

1819
.Prerequisites
1920

@@ -28,7 +29,7 @@ endif::[]
2829

2930
.Procedure
3031

31-
. Run the following `make` commands to build and push your Operator image. Modify the `IMG` argument in the following steps to reference a repository that you have access to. You can obtain an account for storing containers at repository sites such as Quay.io.
32+
. Run the following `make` commands in your Operator project directory to build and push your Operator image. Modify the `IMG` argument in the following steps to reference a repository that you have access to. You can obtain an account for storing containers at repository sites such as Quay.io.
3233

3334
.. Build the image:
3435
+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/operator_sdk/osdk-working-bundle-images.adoc
4+
5+
[id="osdk-bundle-upgrade-olm_{context}"]
6+
= Testing an Operator upgrade on Operator Lifecycle Manager
7+
8+
You can quickly test upgrading your Operator by using Operator Lifecycle Manager (OLM) integration in the Operator SDK, without requiring you to manually manage index images and catalog sources.
9+
10+
The `run bundle-upgrade` subcommand automates triggering an installed Operator to upgrade to a later version by specifying a bundle image for the later version.
11+
12+
.Prerequisites
13+
14+
- Operator installed with OLM by using the `run bundle` subcommand
15+
- A bundle image that represents a later version of the installed Operator
16+
17+
.Procedure
18+
19+
. If your Operator has not already been installed on OLM with the `run bundle` subcommand, install the earlier version of your Operator by specifying the bundle image. For example, for a Memcached Operator:
20+
+
21+
[source,terminal]
22+
----
23+
$ operator-sdk run bundle <registry>/<user>/memcached-operator:v0.0.1
24+
----
25+
+
26+
.Example output
27+
[source,terminal]
28+
----
29+
INFO[0009] Successfully created registry pod: quay-io-demo-memcached-operator-v0-0-1
30+
INFO[0009] Created CatalogSource: memcached-operator-catalog
31+
INFO[0010] OperatorGroup "operator-sdk-og" created
32+
INFO[0010] Created Subscription: memcached-operator-v0-0-1-sub
33+
INFO[0013] Approved InstallPlan install-bqggr for the Subscription: memcached-operator-v0-0-1-sub
34+
INFO[0013] Waiting for ClusterServiceVersion "my-project/memcached-operator.v0.0.1" to reach 'Succeeded' phase
35+
INFO[0013] Waiting for ClusterServiceVersion "my-project/memcached-operator.v0.0.1" to appear
36+
INFO[0019] Found ClusterServiceVersion "my-project/memcached-operator.v0.0.1" phase: Succeeded
37+
----
38+
39+
. Upgrade the installed Operator by specifying the bundle image for the later Operator version:
40+
+
41+
[source,terminal]
42+
----
43+
$ operator-sdk run bundle-upgrade <registry>/<user>/memcached-operator:v0.0.2
44+
----
45+
+
46+
.Example output
47+
[source,terminal]
48+
----
49+
INFO[0002] Found existing subscription with name memcached-operator-v0-0-1-sub and namespace my-project
50+
INFO[0002] Found existing catalog source with name memcached-operator-catalog and namespace my-project
51+
INFO[0009] Successfully created registry pod: quay-io-demo-memcached-operator-v0-0-2
52+
INFO[0009] Updated catalog source memcached-operator-catalog with address and annotations
53+
INFO[0010] Deleted previous registry pod with name "quay-io-demo-memcached-operator-v0-0-1"
54+
INFO[0041] Approved InstallPlan install-gvcjh for the Subscription: memcached-operator-v0-0-1-sub
55+
INFO[0042] Waiting for ClusterServiceVersion "my-project/memcached-operator.v0.0.2" to reach 'Succeeded' phase
56+
INFO[0042] Found ClusterServiceVersion "my-project/memcached-operator.v0.0.2" phase: InstallReady
57+
INFO[0043] Found ClusterServiceVersion "my-project/memcached-operator.v0.0.2" phase: Installing
58+
INFO[0044] Found ClusterServiceVersion "my-project/memcached-operator.v0.0.2" phase: Succeeded
59+
INFO[0044] Successfully upgraded to "memcached-operator.v0.0.2"
60+
----
61+
62+
. Clean up the installed Operators:
63+
+
64+
[source,terminal]
65+
----
66+
$ operator-sdk cleanup memcached-operator
67+
----
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// * operators/operator_sdk/ansible/osdk-ansible-tutorial.adoc
77
// * operators/operator_sdk/helm/osdk-helm-quickstart.adoc
88
// * operators/operator_sdk/helm/osdk-helm-tutorial.adoc
9+
// * operators/operator_sdk/osdk-working-bundle-images.adoc
910

1011
ifeval::["{context}" == "osdk-ansible-quickstart"]
1112
:ansible:
@@ -14,7 +15,7 @@ ifeval::["{context}" == "osdk-ansible-tutorial"]
1415
:ansible:
1516
endif::[]
1617

17-
[id="osdk-create-operator-prereqs_{context}"]
18+
[id="osdk-common-prereqs_{context}"]
1819
= Prerequisites
1920

2021
- xref:../../../operators/operator_sdk/osdk-installing-cli.adoc#osdk-installing-cli[Operator SDK CLI installed]

operators/operator_sdk/ansible/osdk-ansible-quickstart.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Operator SDK includes options for generating an Operator project that levera
99

1010
To demonstrate the basics of setting up and running an link:https://docs.ansible.com/ansible/latest/index.html[Ansible]-based Operator using tools and libraries provided by the Operator SDK, Operator developers can build an example Ansible-based Operator for Memcached, a distributed key-value store, and deploy it to a cluster.
1111

12-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
12+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
1313
include::modules/osdk-quickstart.adoc[leveloffset=+1]
1414

1515
[id="osdk-ansible-quickstart-next-steps"]

operators/operator_sdk/ansible/osdk-ansible-tutorial.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Operator Lifecycle Manager (OLM):: Installation, upgrade, and role-based access
2222
This tutorial goes into greater detail than xref:../../../operators/operator_sdk/ansible/osdk-ansible-quickstart.adoc#osdk-ansible-quickstart[Operator SDK quickstart for Ansible-based Operators].
2323
====
2424

25-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
25+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
2626

2727
include::modules/osdk-create-project.adoc[leveloffset=+1]
2828
include::modules/osdk-project-file.adoc[leveloffset=+2]

operators/operator_sdk/golang/osdk-golang-quickstart.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc::[]
77

88
To demonstrate the basics of setting up and running a Go-based Operator using tools and libraries provided by the Operator SDK, Operator developers can build an example Go-based Operator for Memcached, a distributed key-value store, and deploy it to a cluster.
99

10-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
10+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
1111
include::modules/osdk-quickstart.adoc[leveloffset=+1]
1212

1313
[id="osdk-golang-quickstart-next-steps"]

operators/operator_sdk/golang/osdk-golang-tutorial.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Operator Lifecycle Manager (OLM):: Installation, upgrade, and role-based access
1818
This tutorial goes into greater detail than xref:../../../operators/operator_sdk/golang/osdk-golang-quickstart.adoc#osdk-golang-quickstart[Operator SDK quickstart for Go-based Operators].
1919
====
2020

21-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
21+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
2222

2323
include::modules/osdk-create-project.adoc[leveloffset=+1]
2424
include::modules/osdk-project-file.adoc[leveloffset=+2]

operators/operator_sdk/helm/osdk-helm-quickstart.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Operator SDK includes options for generating an Operator project that levera
99

1010
To demonstrate the basics of setting up and running an link:https://helm.sh/docs/[Helm]-based Operator using tools and libraries provided by the Operator SDK, Operator developers can build an example Helm-based Operator for Nginx and deploy it to a cluster.
1111

12-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
12+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
1313
include::modules/osdk-quickstart.adoc[leveloffset=+1]
1414

1515
[id="osdk-helm-quickstart-next-steps"]

operators/operator_sdk/helm/osdk-helm-tutorial.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Operator Lifecycle Manager (OLM):: Installation, upgrade, and role-based access
2222
This tutorial goes into greater detail than xref:../../../operators/operator_sdk/helm/osdk-helm-quickstart.adoc#osdk-helm-quickstart[Operator SDK quickstart for Helm-based Operators].
2323
====
2424

25-
include::modules/osdk-create-operator-prereqs.adoc[leveloffset=+1]
25+
include::modules/osdk-common-prereqs.adoc[leveloffset=+1]
2626

2727
include::modules/osdk-create-project.adoc[leveloffset=+1]
2828
include::modules/osdk-helm-existing-chart.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)