Skip to content

Conversation

@anik120
Copy link

@anik120 anik120 commented Sep 19, 2025

No description provided.

@anik120 anik120 force-pushed the olmv1-single-own-namespace branch from c9b7c0f to ac0ba97 Compare September 19, 2025 19:10
@anik120 anik120 changed the title OLMv1 single/own namespace install mode support OPRUN-4133: OLMv1 single/own namespace install mode support Sep 19, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 19, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 19, 2025

@anik120: This pull request references OPRUN-4133 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@anik120 anik120 force-pushed the olmv1-single-own-namespace branch from ac0ba97 to 8d51ffd Compare October 3, 2025 02:40
Copy link
Author

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

@perdasilva addressed your feedback, PTAL

//
// inline must be set if configType is 'Inline'.
//
// +kubebuilder:validation:Type=object

Choose a reason for hiding this comment

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

It might be worth calling out that adding this annotation ensures that inputs that are valid json, but not key/value config, are rejected. E.g. something like just true is valid JSON (a boolean), but it wouldn't be valid configuration. Enforcing an object ensures that we have something that resembles a configuration/values files, e.g. key: value.

We should also think about empty object mechanics here, e.g. {}. Maybe that should be treated as no configuration and defaults used (cc @joelanford wdyt?).

Copy link
Author

Choose a reason for hiding this comment

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

Added a comment about the key/value config.

We should also think about empty object mechanics here, e.g. {}. Maybe that should be treated as no configuration and defaults used

Or should we prevent empty objects in the first place?

Choose a reason for hiding this comment

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

That's my initial instinct. I just don't know if there's an use-case where you'd want to specifically set an empty configuration. I can't think of one, but that doesn't mean there isn't one XD

Choose a reason for hiding this comment

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

I've updated the doc strings upstream, so we may want to update this section a little for those changes (although I'm still waiting on an approval for that PR) ref

Or, just put a link to the upstream definition at main and say that this excerpt is at the time or writing and that doc strings may vary (but the structure itself it this - unless new types are added)

@anik120 anik120 force-pushed the olmv1-single-own-namespace branch from 8d51ffd to a93ffa3 Compare October 13, 2025 16:05
- Re-introducing multi-tenancy features or supporting multiple installations of the same operator
- Supporting MultiNamespace install mode (watching multiple namespaces)
- Modifying the fundamental OLM v1 architecture or adding complex multi-tenancy logic
- Supporting install mode switching after initial installation as a first-class feature
Copy link
Member

Choose a reason for hiding this comment

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

Since we are treating this as configuration, I think we would support install mode switching, right? Because, more generally, we're allowing configuration to be changed.

Copy link
Author

Choose a reason for hiding this comment

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

@perdasilva could you chime in here (I'm going off of Per's instruction to include this point here)

Copy link

@perdasilva perdasilva Oct 14, 2025

Choose a reason for hiding this comment

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

I think there's a distinction that could be better worded here. Supporting install mode switching could mean a couple of things:

  1. you can change the value of/remove watchNamespace
  2. that change will work

I think 1 is in scope and 2 is not. It would be up to the author to make that happen, or to be able to recover from that switch. OLMv1 will just compute the correct resources and pivot towards them.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Some general high-level comments/questions.

Nothing that I would block merging of the EP on.

Thanks for bearing with me and making all the updates you did.

I'm looking forward to promoting this feature to GA in 4.22 :).

/lgtm

### Workflow Description

The standard OLMv1 installation and upgrade workflows stay largely the same. Where it will differ is:
- users will need to consult the [OpenShift documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html-single/extensions/index#olmv1-deploying-a-ce-in-a-specific-namespace_managing-ce) to understand how packages/bundles can be configured. The OpenShift documentation will include a capability matrix (derived from the table in the "registry+v1 Configuration Schema" section below) that maps bundle install mode support to configuration requirements, specifically:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note that the currently linked documentation does not explain the new configuration interface and instead relies on an annotation-based API for configuring the watch namespace.

We should ensure this documentation is updated to reflect the current state of the feature usage and how an end-user determines what is and is not valid to put in the configuration.


OLM's JSON Schema validator will support several custom formats that bundle authors can opt-in to use in their configuration schemas:

- `namespaceName`: Will validate that the input is a valid Kubernetes namespace name (follows DNS-1123 subdomain format). This will be useful for any configuration field that accepts a namespace name.
Copy link
Contributor

Choose a reason for hiding this comment

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

No strong preference here, but just wanted to note that the format for a Kubernetes namespace is well known and there is a concrete regular expression that can be used in a pattern validation.

Might save you some overhead in custom validator code if the recommendation is for bundle authors to just use that regex instead of a custom validation format.

- [ ] Documentation for configuration and usage

### Tech Preview -> GA
- [ ] 1 OCP release of alpha feedback
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a general pulse, has the feature in it's current state with the opaque configuration field been shipped in a TPNU release yet?

The 4.20 documentation referenced earlier in this EP seemed to use an annotation-based API for the watch namespace configuration.

Choose a reason for hiding this comment

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

That's a good call out. It would be going out TPNU for 4.21. It was using an annotation-based configuration in 4.20, I believe. I'll talk with Mike to ensure we get gud docs for this in for 4.21.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 12, 2025
Copy link

@oceanc80 oceanc80 left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: everettraven, oceanc80
Once this PR has been reviewed and has the lgtm label, please assign coverprice for approval. For more information see the Code Review Process.

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

Details 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

- User does not provide required configuration fields
- User provides configuration keys that are not existent
- User provides configuration but bundle does not provide a configuration schema - note that
while for registry+v1 bundles this is deemed a good level of restriction to ship the configuration feature with initially, for future bundle formats this restriction may be loosed (eg OLMv1 could allow users to provide configuration for "Helm bundles" without any configuration schema). Users will likely be required to express their intent to configure such bundles explicity and have OLM install anyway, possibly via a ClusterExtension API field (eg `dangerouslyAcceptBundlesWithoutConfigSchema`). Such considerations however are for future considerations.
Copy link
Member

Choose a reason for hiding this comment

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

Do we have an idea where in the API we'd put knobs like this? Do we need to make sure there is space in the spec.config struct since this is a config-specific knob? Or do we envision putting this kind of thing directly in .spec?

Choose a reason for hiding this comment

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

probably around the install configuration like respecting upgrade graph, etc.


*Mitigations*:
- Don't give read access to ClusterExtensions, or ClusterExtensions with privileged information to anyone without access to the secret information.
- Don't install the application and contact the supplier and ask for a change in the configuration s.t. a secret reference can be given instead. This also solves the replication issue and ensures no additional copies of the information exist on the cluster between the source (Secret) and the point of use.
Copy link
Member

Choose a reason for hiding this comment

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

Is there somewhere we would be able to document this for operator authors? Or maybe implement a linter that checks configuration schemas for fields that look like they are named in a way that would contain inlined secrets?

Copy link
Member

Choose a reason for hiding this comment

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

Not crucial right now, since we don't support bundles with embedded schemas, but something we would ideally get ahead of to avoid these problems in the first place.

Because we are enabling namespace-scoped operator installations, there are operational implications that could impact cluster management. These risks are mitigated by:

- **RBAC Misconfiguration**: Install mode validation ensures operators only receive permissions appropriate for their scope
- **Namespace Dependency**: Clear error messages when target namespaces don't exist or aren't accessible
Copy link
Member

Choose a reason for hiding this comment

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

Is there any other mention of erroring when the target namespace doesn't exist? I suppose at a minimum we would fail at the point of trying to create Role/RoleBinding in that namespace? Is that what we're talking about here, or are we talking about a proactive check that happens separate from the normal flow of applying resources?

What if the CSV contains no permissions, which would mean we wouldn't actually need to create anything in the watch namespace (iirc)?

Choose a reason for hiding this comment

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

The installation would probably work. But it wouldn't be useful in any meaningful way. We probably need to think about checking these kinds of dependencies during the runtime though. I'll add a note to say, when there are bundle generated resources that should be applied to the watchNamespace

Copy link
Member

Choose a reason for hiding this comment

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

And to be clear, I don't think we should preflight check this. If the namespace exists now, but then is deleted in the future, we'll have already installed and we'll run into the issue of "can't create resource X in namespace Y" anyway. And we won't want to have a preflight check that fails in the future cause us to not be able to reconcile unaffected objects in other namespaces.


**Installation Success Rate:**

* **RBAC Validation Complexity:** Namespace-scoped installations require more complex RBAC validation to ensure the ServiceAccount has appropriate permissions for the target namespace. RBAC misconfigurations that work in AllNamespaces mode may fail in Single/OwnNamespace modes.
Copy link
Member

Choose a reason for hiding this comment

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

Is there a particular OLMv1-specific concern here? Or are we trying to reiterate something about the existing complexity of registry+v1 bundles in general?

Choose a reason for hiding this comment

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

I think more of the latter. Just calling out RBAC gets more complex for these install modes


**Installation Time:**

* **RBAC Generation Complexity:** Converting CSV `permission` to namespace-scoped Role/RoleBinding resources requires additional processing time. Complex operators with extensive permission requirements will see increased installation duration.
Copy link
Member

Choose a reason for hiding this comment

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

This is not true, is it?

  • When watching all namespaces: Create a ClusterRole/ClusterRoleBinding for each set of permissions
  • When watching a single namespace: Create a Role/RoleBinding in the watched namespace for each set of permissions

Either way the computational complexity is identical, is it not?

Choose a reason for hiding this comment

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

Yeah, let's remove this. I don't think the install time difference would be measurable/noticeable in any meaningful way

**Operator Availability:**

* **ServiceAccount Permission Dependencies:** Namespace-scoped operators depend on ServiceAccount permissions that may be modified by namespace administrators, creating additional failure points not present in cluster-scoped installations.
* Example: Namespace admin removes critical RoleBinding, causing operator to lose access to required resources.
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't OLMv1 re-create this RoleBinding?

Copy link
Member

Choose a reason for hiding this comment

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

Also, how is this different than a cluster admin deleting a ClusterRoleBinding when an operator is watching all namespaces?

Choose a reason for hiding this comment

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

You're right! Let's remove.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2025
Per Goncalves da Silva and others added 2 commits December 17, 2025 14:24
@anik120
Copy link
Author

anik120 commented Dec 17, 2025

@joelanford PTAL

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 17, 2025

@anik120: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@perdasilva
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants