Skip to content

Commit ffb66b0

Browse files
authored
Merge pull request #1905 from jmccormick2001/docs-channel-naming-design
Docs channel naming design
2 parents 4b66803 + 6567495 commit ffb66b0

File tree

3 files changed

+178
-0
lines changed

3 files changed

+178
-0
lines changed

doc/design/channel-naming.md

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