You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I rewrote both the OLM Operator and Catalog Operator responsibility paragraphs. I tried to include all the previous details and further elaborate on how various items lead into the next to reduce confusion and make this helpful for those trying to understand what steps depend on the next for deep debugging reasons.
Copy file name to clipboardExpand all lines: doc/design/architecture.md
+16-29Lines changed: 16 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Architecture
2
2
3
-
OLM is composed of two Operators: the OLM Operator and the Catalog Operator. There is also the Package Server, an optional veneer API, that is deployed by default.
3
+
OLM is composed of two Operators: the OLM Operator and the Catalog Operator.
4
4
5
5
Each of these Operators is responsible for managing the CRDs that are the basis for the OLM framework:
6
6
@@ -12,19 +12,16 @@ Each of these Operators is responsible for managing the CRDs that are the basis
12
12
| Subscription | sub | Catalog | used to keep CSVs up to date by tracking a channel in a package |
13
13
| OperatorGroup | og | OLM | used to group multiple namespaces and prepare for use by an operator |
14
14
15
-
In addition, a PackageManifest resource provides the user with an API presentation of the data a CatalogSource provides. This is not an actual CRD, but a simpler synthetic aggregated API resource. As a result, it cannot be managed in the same manner as a CRD.
16
-
17
15
Each of these Operators are also responsible for creating resources:
18
16
19
-
| Component | Managed Resources |
20
-
|-----------|----------------------------|
21
-
| OLM | Deployment |
22
-
| Catalog | Service Account |
23
-
| Catalog | (Cluster)Roles |
24
-
| Catalog | (Cluster)RoleBindings |
25
-
| Catalog | Custom Resource Definition |
26
-
| Catalog | ClusterServiceVersion |
27
-
| Package Server | PackageManifest |
17
+
| Operator | Creatable Resources |
18
+
|----------|----------------------------|
19
+
| OLM | Deployment |
20
+
| OLM | Service Account |
21
+
| OLM | (Cluster)Roles |
22
+
| OLM | (Cluster)RoleBindings |
23
+
| Catalog | Custom Resource Definition |
24
+
| Catalog | ClusterServiceVersion |
28
25
29
26
## What is a ClusterServiceVersion
30
27
@@ -47,13 +44,11 @@ ClusterServiceVersion:
47
44
48
45
## OLM Operator
49
46
50
-
The OLM Operator is responsible for installing applications defined by ClusterServiceVersion resources once the required resources specified in the ClusterServiceVersion are present in the cluster.
51
-
52
-
The OLM Operator is not concerned with the creation of the required resources; users can choose to manually create these resources using `kubectl` or users can choose to create these resources using the Catalog Operator, such as through a Subscription.
47
+
The OLM Operator is responsible for installing applications defined by a `ClusterServiceVersion` resources once the required resources specified in the CSV are present in the cluster (the job of the Cluster Operator). This may be as simple as setting up a single `Deployment` resulting in an operator's pod becoming available. The OLM Operator is not concerned with the creation of the underlying resources. If this is not done manually, the Catalog Operator can help provide resolution of these needs.
53
48
54
-
This separation of concern enables users incremental buy-in in terms of how much of the OLM framework they choose to leverage for their application.
49
+
This separation of concerns enables users incremental buy-in of the OLM framework components. Users can choose to manually create these resources, or define an InstallPlan for the Catalog Operator or allow the Catalog Operator to develop and implement the InstallPlan. An operator creator does not need to learn about the full operator package system before seeing a working operator.
55
50
56
-
While the OLM Operator is often configured to watch all namespaces, it can also be operated alongside other OLM Operators so long as they all manage separate namespaces.
51
+
While the OLM Operator is often configured to watch all namespaces, it can also be operated alongside other OLM Operators so long as they all manage separate namespaces defined by `OperatorGroups`.
57
52
58
53
### ClusterServiceVersion Control Loop
59
54
@@ -87,13 +82,13 @@ Replacing --> Deleting
87
82
88
83
## Catalog Operator
89
84
90
-
The Catalog Operator is responsible for resolving ClusterServiceVersions and the required resources they specify. It is also responsible for watching CatalogSources. It updates to packages in channels, and upgrading them (optionally automatically) to the latest available versions. It also starts and maintains pods required to provide the grpc endpoints from container images those CatalogSources identify.
85
+
The Catalog Operator is responsible for monitoring `Subscriptions`, `CatalogSources`and the catalogs themselves. When it finds a new or changed `Subscription`, it builds out the subscribed Operator. When it finds a new or changed CatalogSource it builds out the required catalog, if appropriate, and begins regular monitoring of the package in the catalog. The packages in the catalog will include various `ClusterServiceVersions`, `CustomResourceDefinitions`and a channel list for each package. A catalog has packages. A package has channels and CSVs. A Channels identifies a specific CSV. The CSVs identify specific CRDs.
91
86
92
-
The process works this way. A user that wishes to track a package in a channel creates a Subscription resource configuring the desired package, channel, and the catalog source from which to pull updates. When updates are found, an appropriate InstallPlan is written into the namespace on behalf of the user. Users can also create their own InstallPlan resource directly, containing the names of the desired ClusterServiceVersions and an approval strategy. The Catalog Operator will then create an execution plan for the creation of all of the required resources and update the InstallPlan with that information.
87
+
A user wanting a specific operator creates a `Subscription` which identifies a catalog, operator and channel within that operator. The Catalog Operator then receives that information and queries the catalog for the latest version of the channel requested. Then it looks up the appropriate `ClusterServiceVersion` identified by the channel and turns that into an `InstallPlan`. When updates are found in the catalog for the channel, a similar process occurs resulting in a new `InstallPlan`. (Users can also create an InstallPlan resource directly, containing the names of the desired ClusterServiceVersions and an approval strategy.)
93
88
94
-
If manual approval is required, the Catalog Operator now waits for the InstallPlan to be marked `approved`. Otherwise, it moves on to the next step.
89
+
When the Catalog Operator find a new `InstallPlan`, even though it likely created it, it will create an "execution plan" and embed that into the `InstallPlan` to create all of the required resources. Once approved, whether manually or automatically, the Catalog Operator will implement its portion of the the execution plan, satisfying the underlying expectations of the OLM Operator.
95
90
96
-
Then Catalog Operator will create all of the resources in an InstallPlan; this should independently satisfy the OLM Operator, which will complete the operator deployment.
91
+
The OLM Operator will then pickup the installation and carry it through to completion of everything required in the identified CSV.
| UpgradePending |`InstallPlan` has been created (referenced in `status.installplan`) to install a new CSV |
129
124
| AtLatestKnown |`status.installedCSV` matches the latest available CSV in catalog |
130
125
131
-
## Package Server
132
-
133
-
The Package Server provides a veneer API over the CatalogSource resources and the information they provide to ease user interaction.
134
-
135
-
It is not neccessary to run this for OLM to function, but enhances the user experience by providing the information needed for Subscription generation to the user. In a Production scenario where no discovery work is needed and all Subscriptions are predefined, this may be removed.
136
-
137
-
Client GUI interfaces will use this API extention to present operator package information such as CSVs, packages and CRDs found in the CatalogSource to users. Additionally, CLI tools are able to examine the list of PackageManifests to list out available Operators and then examine the specific PackageManifests resources to find the appropriate data to build a Subscription to it.
138
-
139
126
## Catalog (Registry) Design
140
127
141
128
The Catalog Registry stores CSVs and CRDs for creation in a cluster, and stores metadata about packages and channels.
0 commit comments