Skip to content

Commit a6cd32f

Browse files
committed
docs(operatorgroups): add more extensive docs
1 parent e40d4f4 commit a6cd32f

File tree

4 files changed

+226
-21
lines changed

4 files changed

+226
-21
lines changed

Documentation/design/architecture.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Each of these Operators are responsible for managing the CRDs that are the basis
1010
| InstallPlan | ip | Catalog | calculated list of resources to be created in order to automatically install/upgrade a CSV |
1111
| CatalogSource | catsrc | Catalog | a repository of CSVs, CRDs, and packages that define an application |
1212
| Subscription | sub | Catalog | used to keep CSVs up to date by tracking a channel in a package |
13-
| OperatorGroup | og | OLM | method to group multiple namespaces and prepare for use by an operator |
13+
| OperatorGroup | og | OLM | used to group multiple namespaces and prepare for use by an operator |
1414

1515
Each of these Operators are also responsible for creating resources:
1616

@@ -21,7 +21,7 @@ Each of these Operators are also responsible for creating resources:
2121
| OLM | (Cluster)Roles |
2222
| OLM | (Cluster)RoleBindings |
2323
| Catalog | Custom Resource Definition |
24-
| Catalog | ClusterServiceVersion |
24+
| Catalog | ClusterServiceVersion |
2525

2626
## What is a ClusterServiceVersion
2727

@@ -78,6 +78,7 @@ Replacing --> Deleting
7878
| Failed | upon failed execution of the Install Strategy, or an installed component dissapears the CSV transitions to this phase; if the component can be recreated by OLM, this may transition to `Pending` |
7979
| Replacing | a newer CSV that replaces this one has been discovered in the cluster. This status means the CSV is marked for GC |
8080
| Deleting | the GC loop has determined this CSV is safe to delete from the cluster. It will disappear soon. |
81+
> Note: In order to transition, a CSV must first be an active member of an OperatorGroup
8182
8283
## Catalog Operator
8384

@@ -134,17 +135,3 @@ Package {name}
134135
|
135136
+-- Channel {name} --> CSV {version}
136137
```
137-
138-
## Operator Group design
139-
140-
An operator group consists of a group of target namespaces as specified by the label selector in the spec, plus the namespace that the operator group is created within known as the operator namespace. The operator namespace is always considered to also be a target namespace, without regard to matching the label selector. The operator namespace is where the operator actually runs and the target namespace(s) are namespaces the operator have permissions to operate in.
141-
142-
Once an operator group has been created, the focus is around the target namespaces and the resources contained in those namespaces. The status for an operator group is constantly updated to always list the namespaces matching the label selector as specified in the spec. In addition to maintaining an updated status, the operator group control loop also maintains creating RBAC rules and providing operator group knowledge to operators. Some operations such as copying CSVs and creating additional RBAC rules are handled by the CSV control loop. Details for these operations are described further below.
143-
144-
RBAC rules are created for two reasons. The first reason is for restricting access to the API (CRDs) of the installed operators. It is possible that the administrator does not want the full functionality of the operator to be granted in all cases. The second reason is to give the operator the necessary permissions to operate, which is tied to the specified operator group service account.
145-
146-
Operator group target namespace information is made available to operators via annotations on the deployment. A second step of using downward API is technically necessary to pass this information, which is used to know where the operator has permissions to operate.
147-
148-
Each CSV in the operator namespace is copied into the target namespace(s), which is done in case a user does not have access to the operator namespace. The copied CSV is annotated with the operator group name and the operator namespace (the target namespace list is intentionally not included for security reasons).
149-
150-
In summary, the goal of the above functionality is to assist in bringing multitenancy features to running operators in a cluster in the easiest most automated way. For creating your own operator group resource, refer to the operator group custom resource definition file in the templates directory.

Documentation/design/building-your-csv.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ The metadata section contains general metadata around the name, version and othe
239239
**Selectors** (optional): A label selector to identify related resources. Set this to select on current labels applied to this CSV object (if applicable).
240240

241241
**InstallModes**: A set of `InstallMode`s that tell OLM which `OperatorGroup`s an Operator can belong to. Belonging to an `OperatorGroup` means that OLM provides the set of targetted namespaces as an annotation on the Operator's CSV and any deployments defined therin. These deployments can then untilize [the Downward API](https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#the-downward-api) to inject the list of namespaces into its container(s). An `InstallMode` consists of an `InstallModeType` field and a boolean `Supported` field. There are four `InstallModeTypes`:
242-
* `OwnNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` must contain the namespace the Operator is to be installed in.
243-
* `SingleNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` can be of length 1.
244-
* `MultiNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` can be of length >= 1. Any Operator supporting `MultiNamespace` implicitly supports `SingleNamespace` as well.
245-
* `AllNamespaces`: If supported, the Operator can support an `OperatorGroup` that selects all namespaces with a targetted set = [""]. Any Operator supporting `AllNamespaces` implicity supports `OwnNamespace` as well.
242+
* `OwnNamespace`: If supported, the operator can be a member of an `OperatorGroup` that selects its own namespace
243+
* `SingleNamespace`: If supported, the operator can be a member of an `OperatorGroup` that selects one namespace
244+
* `MultiNamespace`: If supported, the operator can be a member of an `OperatorGroup` that selects more than one namespace
245+
* `AllNamespaces`: If supported, the operator can be a member of an `OperatorGroup` that selects all namespaces (target namespace set is the empty string "")
246246

247247
Here's an example:
248248

0 commit comments

Comments
 (0)