Skip to content

Commit e4fc40b

Browse files
authored
Rewrite
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.
1 parent a42e1ac commit e4fc40b

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

doc/design/architecture.md

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Architecture
22

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.
44

55
Each of these Operators is responsible for managing the CRDs that are the basis for the OLM framework:
66

@@ -12,19 +12,16 @@ Each of these Operators is responsible for managing the CRDs that are the basis
1212
| Subscription | sub | Catalog | used to keep CSVs up to date by tracking a channel in a package |
1313
| OperatorGroup | og | OLM | used to group multiple namespaces and prepare for use by an operator |
1414

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-
1715
Each of these Operators are also responsible for creating resources:
1816

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 |
2825

2926
## What is a ClusterServiceVersion
3027

@@ -47,13 +44,11 @@ ClusterServiceVersion:
4744

4845
## OLM Operator
4946

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.
5348

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.
5550

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`.
5752

5853
### ClusterServiceVersion Control Loop
5954

@@ -87,13 +82,13 @@ Replacing --> Deleting
8782
8883
## Catalog Operator
8984

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.
9186

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.)
9388

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.
9590

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.
9792

9893
### InstallPlan Control Loop
9994

@@ -128,14 +123,6 @@ None --> UpgradeAvailable --> UpgradePending --> AtLatestKnown -+
128123
| UpgradePending | `InstallPlan` has been created (referenced in `status.installplan`) to install a new CSV |
129124
| AtLatestKnown | `status.installedCSV` matches the latest available CSV in catalog |
130125

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-
139126
## Catalog (Registry) Design
140127

141128
The Catalog Registry stores CSVs and CRDs for creation in a cluster, and stores metadata about packages and channels.

0 commit comments

Comments
 (0)