Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(operatorgroups): add more extensive docs #721

Merged

Conversation

njhale
Copy link
Member

@njhale njhale commented Feb 20, 2019

Document OperatorGroup purpose and behavior in high fidelity.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 20, 2019
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 20, 2019
@njhale njhale force-pushed the operatorgroup-docs branch from 1d134f6 to 38edf47 Compare February 21, 2019 12:15
@njhale njhale changed the title [WIP] docs(operatorgroups): add more extensive docs docs(operatorgroups): add more extensive docs Feb 21, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 21, 2019
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! There were a couple of small suggestions, but I love how detailed this is. We should write more docs like this.

* Contains the namespace of the `OperatorGroup`
* `olm.targetNamespaces=<target-namespaces>`
* Contains a comma-delimited string listing the `OperatorGroup`'s target namespace selection. This annotation is projected onto the pod template of a CSV's deployments and can be consumed by a pod instance via [The Downward API](https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#the-downward-api)
* If the CSV does not [have a Copied status reason](#copied-csvs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing the end of the sentence?

* `OwnNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` must contain the namespace the Operator is to be installed in.
* `SingleNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` can be of length 1.
* `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.
* `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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we would install an operator with ‘AllNamespaces’ into a group watching one namespaces, so I think that this extra comment makes sense

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just means that any CSV supporting AllNamespaces must also support OwnNamespace - For reference OwnNamespace doesn't imply SingleNamespace.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But can't I write an operator that starts up and watches all namespaces, but can't be deployed in a configuration that watches only its own namespace?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current implementation, OwnNamespace is an additional restriction on an OperatorGroup’s namespace set. More specifically, it means that a CSV can be a member of an OperatorGroup whose target namespace set includes the CSV’s namespace. This rule applies to Single, Multi, and All, rather than just applying to Single (see https://github.com/operator-framework/operator-lifecycle-manager/blob/master/pkg/api/apis/operators/v1alpha1/clusterserviceversion.go#L99).

We can change this logic to match your definition (It makes sense to) - but I think a change like that warrants a follow up PR.

namespaces:
- local
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should introduce the Copied status and the static provided apis around here; they’re referenced frequently in the intersection section.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been updated to reflect your comments - forgot to push this morning.

@njhale njhale force-pushed the operatorgroup-docs branch from 38edf47 to 8d63163 Compare February 21, 2019 19:09
@njhale
Copy link
Member Author

njhale commented Feb 22, 2019

/retest

3 similar comments
@njhale
Copy link
Member Author

njhale commented Feb 22, 2019

/retest

@njhale
Copy link
Member Author

njhale commented Feb 23, 2019

/retest

@njhale
Copy link
Member Author

njhale commented Feb 24, 2019

/retest

Copy link
Member

@alecmerdler alecmerdler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome docs, Nick. I finally put my Technical Writing 101 skills to use in this review.


* An `OperatorGroup` selects a set of target namespaces in which to generate required RBAC access for its member operators.
* The set of target namespaces is provided via a comma-delimited string stored in the `olm.targetNamespaces` annotation. This annotation is applied to member operator's deployments and is accessible through [The Downward API](https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#the-downward-api)
* An operator is said to be a [member of an `OperatorGroup`](#operatorgroup-membership) if its CSV exists in the same namespace as the `OperatorGroup` and its CSV's [`InstallModes` support the set of namespaces targetted by the `OperatorGroup`](#installmodes-and-supported-operatorgroups)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be better to split out InstallModes to a separate bullet (or remove from "OperatorGroup Overview") to simplify what it means to belong to an OperatorGroup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides being in the same namespace, InstallModes are the primary factor in determining membership. I think it makes sense for it to be in the overview. InstallModes are tightly coupled to membership so I feel that putting it in a separate bullet will dilute that association.
The link serves as a pointer to the definition since I don't want to leave people wondering or ctrl-fing.

@njhale njhale force-pushed the operatorgroup-docs branch from 8d63163 to b4b4a72 Compare February 26, 2019 16:03
@njhale
Copy link
Member Author

njhale commented Feb 27, 2019

/test e2e-aws

Copy link

@SamiSousa SamiSousa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks great! Glad to see more docs on OperatorGroups and InstallModes

metadata:
name: my-group
namespace: my-namespace
targetNamespaces:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec:
  targetNamespaces:

* `OwnNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` must contain the namespace the Operator is to be installed in.
* `SingleNamespace`: If supported, the set of namespaces targetted by an `OperatorGroup` can be of length 1.
* `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.
* `AllNamespaces`: If supported, the set of namespaces targetted by an `OperatorGroup` can be = [""] (which tells operators to watch all namespaces). Any Operator supporting `AllNamespaces` implicity supports `OwnNamespace` as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that OwnNamespace must be set to true if AllNamespaces is supported?

Copy link
Member Author

@njhale njhale Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the current behavior, but not the desired. I'm updating the docs to reflect our desired behavior, in which case OwnNamespace does not need to be set to true if AllNamespaces is supported.

A follow up PR that changes the behavior in OLM is on the way.

@njhale njhale force-pushed the operatorgroup-docs branch from b4b4a72 to 8641c63 Compare February 27, 2019 20:21
@alecmerdler alecmerdler dismissed their stale review February 27, 2019 20:28

Comments addressed

@ecordell
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2019
@njhale njhale force-pushed the operatorgroup-docs branch from 8641c63 to a6cd32f Compare February 27, 2019 20:35
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2019
@ecordell
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2019
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, njhale

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@njhale
Copy link
Member Author

njhale commented Feb 27, 2019

/retest

@openshift-merge-robot openshift-merge-robot merged commit 4cd7c2e into operator-framework:master Feb 28, 2019
ecordell pushed a commit to ecordell/operator-lifecycle-manager that referenced this pull request Mar 8, 2019
docs(operatorgroups): add more extensive docs
@njhale njhale added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 19, 2019
@njhale njhale deleted the operatorgroup-docs branch September 30, 2019 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants