Skip to content

Commit 133627f

Browse files
author
jmccormick2001
committed
initial channel naming doc and related images
1 parent 7062e42 commit 133627f

File tree

3 files changed

+200
-0
lines changed

3 files changed

+200
-0
lines changed

doc/design/channel-naming.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Channel Naming
2+
3+
This guide shows OLM users how to use and choose naming conventions for channels to manage their operator upgrades.
4+
5+
## GOALS
6+
7+
8+
Some goals of this document include:
9+
10+
- Define what a channel is and how it is defined
11+
- Explain different naming conventions for channels and how it impacts operator upgrades
12+
- Describe how operators can be promoted from one channel to another
13+
- Describe future designs for OLM that alter the way channels are used
14+
15+
## CHANNELS
16+
17+
Operator Lifecycle Manager (OLM) provides a channel concept that allows you
18+
as the operator author a means to specify a set of update streams for your
19+
operator.
20+
21+
Operator authors deal with two key tasks associated with OLM channels, first,
22+
how to define a channel for your operator and then lastly how to interact
23+
with OLM to deploy your operator using channels.
24+
25+
For each version of an operator you can specify a channel that it will belong
26+
to. Since there can be multiple versions of an operator within a channel,
27+
there is a notion of the latest version within a channel, or the channel head
28+
version. It's the channel head that OLM will install for most subscriptions.
29+
There can also be multiple channels for a given operator package which is
30+
used to offer different support models (e.g. pre-release, production). Here
31+
is a diagram that shows the relationship of operator versions to channels:
32+
33+
![Channel Naming Image](images/channel-naming1.png)
34+
35+
In the diagram above you can see the following:
36+
37+
- A catalog index named “redhat:v4.6”, this catalog is built by a cluster administrator typically
38+
- There are 2 operator packages found in the catalog, myoperator and otheroperator.
39+
- The myoperator has 3 bundles (1.0.0, 1.0.1, 1.0.2). Versions 1.0.1 and 1.0.1 are in multiple channels (fast, stable). Whereas version 1.0.2 is only in the fast channel.
40+
- The otheroperator has 2 bundles specifying 2 different channels (preview, stable). Version 1.4.0 specifies it is within 2 channels, stable and preview.
41+
42+
43+
Here is the view of another catalog, “redhat:v4.7”, that shows you can change
44+
the upgrade path for an operator by what operator bundles are contained
45+
within the catalog:
46+
47+
![Channel Naming Image](images/channel-naming2.png)
48+
49+
### Defining Channels
50+
51+
Operator authors define the channels they intend to use by creating labels within their operator bundle.  Bundles  contain metadata about a particular operator version.  For example, when you build an operator bundle, you specify an annotations.yaml manifest which gets included into the bundle image.  Here is an example  snippet of an annotations.yaml file including channel information for that operator:
52+
53+
```
54+
annotations:
55+
operators.operatorframework.io.bundle.channels.v1: preview
56+
operators.operatorframework.io.bundle.channel.default.v1: preview
57+
operators.operatorframework.io.bundle.manifests.v1: manifests/
58+
operators.operatorframework.io.bundle.mediatype.v1: registry+v1
59+
operators.operatorframework.io.bundle.metadata.v1: metadata/
60+
operators.operatorframework.io.bundle.package.v1: otheroperator
61+
```
62+
63+
This example shows that you are defining the preview channel to be used for
64+
this operator bundle. Operator bundles are loaded into an Operator Index
65+
image using the opm command. It is important to note that by specifying a
66+
channel value like this, you are essentially creating a channel which can
67+
then be subscribed to. If you mis-type the channel name, there is nothing
68+
that validates the channel value because the channel is known by whatever
69+
you provide.
70+
71+
Note that you can specify a default channel for a given operator package.
72+
This default channel is used when an operator is being installed to fulfill
73+
a dependency requirement of another operator. The dependent operator will
74+
be installed from the dependent operator’s default channel as the first
75+
choice, falling back to other channels the dependent operator provides as
76+
necessary. Default channels for an operator package are determined by the
77+
order in which operator bundles are added to the catalog, with the last
78+
bundle’s default channel value being used. Note the default channel is
79+
also used if you create a Subscription that doesn’t specify a channel.
80+
81+
If your operator bundles do not specify a default channel, a default channel
82+
will be picked by OLM based on the lexical ordering of the channels you have
83+
specified. For example, if your bundles specified channels of preview and
84+
stable, then preview would be picked based solely on the names chosen and
85+
character ordering (e.g. ‘p’ comes before ‘s’). Dependency resolution is
86+
described in more detail here.
87+
88+
### Deploying Operators from Channels
89+
90+
When an end user or administrator wants to deploy an operator using OLM,
91+
they create a Subscription. For example, here is a Subscription manifest:
92+
93+
```
94+
apiVersion: operators.coreos.com/v1alpha1
95+
kind: Subscription
96+
metadata:
97+
name: sample-subscription
98+
namespace: my-operators
99+
spec:
100+
channel: preview
101+
name: sampleoperator
102+
source: sample-operator
103+
sourceNamespace: my-operators
104+
```
105+
106+
The Subscription is providing hints to OLM which are used to determine
107+
exactly which version of an operator will get deployed onto the cluster, in
108+
this example OLM will look for an operator to deploy that belongs to the
109+
preview channel within a specified catalog index source.
110+
111+
Note that exactly which operator version is deployed can depend on more than
112+
what you specify in the Subscription. On initial install, OLM will always
113+
attempt to install whatever is the head of the specified channel by default.
114+
Settings within the operator’s CSV also are used by OLM to determine exactly
115+
which operator version OLM will deploy or upgrade.
116+
117+
## NAMING
118+
119+
Channel names are used to imply what form of upgrade you want to offer for
120+
your operator. For example, you might have an operator that has a preview or
121+
alpha version which is not supported as well as a version where support is
122+
offered.
123+
124+
The names you choose are notional and up to you to decide, however, picking
125+
good channel names requires some basic guidance. What is described below
126+
are different channel naming conventions that are commonly used by the
127+
operator community to denote different operator upgrade use cases.
128+
129+
### Naming Convention Rules
130+
131+
* Channel names are chosen by operator authors as they see fit to meet their upgrade strategies.
132+
* Channel names are unique to your operator and do not collide with channel names used by other operator providers.
133+
* Seldom is there a situation where your channel names need to contain information about the Kubernetes or Openshift cluster version they run on. Only in the case where your operator versions have a dependency on the Kubernetes/Openshift version would you include the cluster version in your channel name.
134+
* You typically would not include product names in your channels since the channels are unique to your product and will not collide with other channel names used by other operators.
135+
* You could include or have an operand version in your channel name to advertise to consumers the version of operand they can subscribe to.
136+
137+
138+
### Recommended Channel Naming
139+
140+
#### Example 1
141+
142+
| Channel Name | Purpose |
143+
| :------------- | -----------: |
144+
| preview | Pre-release operators that would typically not have support offered and might be considered experimental. |
145+
| fast | Released, supported operators which are still being monitored to assess stability/quality prior to promoting them as stable. Generally used by early adopters or for testing in pre-production environments. |
146+
| stable | Released, supported operators that have been observed to be stable through usage by consumers of the fast channel.\| |
147+
148+
With the above channel naming convention, you are always moving end users to
149+
the latest versions of your operator. For example you could create a
150+
version 1.1.1 that is considered fast, adding it to the fast channel. Users
151+
can experiment with that fast version, but the stable version for example
152+
1.2.0 would be added only to the stable channel.
153+
154+
#### Example 2
155+
156+
A possible but less typical case might be where an operator wants to be
157+
supported at various operator major/minor versions For example you might
158+
have an operator version at 1.3 and also at 2.4 that you need or want to
159+
offer support for at the same time. However, you might not want to have
160+
OLM upgrade users to the 2.4 operator but instead keep them upgrading within
161+
the 1.3 versions. In that case, you would end up with channels as
162+
recommended above but with major/minor version information applied as follows:
163+
164+
| Channels for 1.3 | Channels for 2.4 |
165+
| :------------- | -----------: |
166+
| preview-1.3 | preview-2.4 |
167+
| fast-1.3 | fast-2.4 |
168+
| stable-1.3 | stable-2.4 \| |
169+
170+
#### Example 3
171+
172+
Another form of channel naming might have the operand version be specified
173+
instead of the operator version. For example, consider a database operator
174+
that has operands of different database versions such as Version 12 or
175+
Version 13. In this case, you might have the need to advertise your
176+
channels by the operand version as follows:
177+
178+
| Channels for Postgres 12 | Channels for Postgres 13 |
179+
| :------------- | -----------: |
180+
| preview-pg-12 | preview-pg-13 |
181+
| fast-pg-12 | fast-pg-13 |
182+
| stable-pg-12 | stable-pg-13 \| |
183+
184+
In this example, subscribers know which database version they are subscribing
185+
to and don’t necessarily care which operator version is being used, but will
186+
likely just want the latest operator version in that channel. As with the
187+
previous naming convention examples, we start the channel name with
188+
preview/fast/stable to denote the maturity level of the operator. Using all
189+
3 naming prefixes is optional, you might only want to support a stable channel.
190+
191+
# CHANNEL PROMOTION
192+
193+
Channel promotion is the notion of moving an operator from one channel to
194+
another. For example, consider the case where you have an operator version
195+
1.0.1 which is found in a preview channel, then you might decide to offer
196+
support for that version and want to move it to a stable channel.
197+
198+
Today, channel promotion is achieved by creating a new operator version
199+
(1.0.2) that is labeled with the channel(s) you want to promote to (as well
200+
as any channels you want to keep it in).

doc/design/images/channel-naming1.png

33 KB
Loading

doc/design/images/channel-naming2.png

54.3 KB
Loading

0 commit comments

Comments
 (0)