Skip to content

Commit 60d6fd0

Browse files
committed
Incorporate changes to OwnNamespace default handling procedure
More info: operator-framework/operator-controller#2283
1 parent 283340b commit 60d6fd0

File tree

1 file changed

+65
-38
lines changed

1 file changed

+65
-38
lines changed

enhancements/olm/single-ownnamespace-enhancement-proposal.md

Lines changed: 65 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# OLM v1 Single and OwnNamespace Install Mode Support
2-
1+
---
32
title: single-ownnamespace-enhancement-proposal
43
authors:
54
- anbhatta
@@ -9,14 +8,16 @@ reviewers:
98
approvers:
109
- joelanford
1110
api-approvers: # In case of new or modified APIs or API extensions (CRDs, aggregated apiservers, webhooks, finalizers). If there is no API change, use "None"
12-
- JoelSpeed
1311
- everettraven
1412
creation-date: 2025-09-19
1513
last-updated: 2025-10-21
1614
tracking-link: # link to the tracking ticket (for example: Jira Feature or Epic ticket) that corresponds to this enhancement
1715
- https://issues.redhat.com/browse/OPRUN-4133
16+
---
1817

1918

19+
# OLM v1 Single and OwnNamespace Install Mode Support
20+
2021
## Summary
2122

2223
This enhancement proposes adding limited compatibility support for operator bundles that only declare `Single` and `OwnNamespace` install modes. These bundles are shipped in OpenShift within existing operator catalogs and contain installation bundles installable with OLM v0 (registry+v1 format). This feature enables the rendering and installation of registry+v1 bundles that declare only namespace-scoped install modes, providing a migration path from OLM v0 while maintaining OLM v1's stance on NOT supporting OLMv0's multi-tenancy model.
@@ -39,6 +40,22 @@ Future OLM v1 bundle formats will not include these legacy install mode concepts
3940

4041
The registry+v1 bundle format (used by OLM v0) includes install mode declarations (AllNamespaces, MultiNamespace, SingleNamespace, OwnNamespace) that affect how bundles are rendered into Kubernetes manifests. OLM v1 deliberately simplified operator installation by focusing on AllNamespaces mode to avoid complexity, but there exists significant existing registry+v1 bundle content in catalogs that only declares support for Single and OwnNamespace install modes.
4142

43+
### Install Mode Upgrade Behavior Edge Case
44+
45+
An important edge case exists around bundle upgrades and install mode behavior consistency. Consider this scenario:
46+
47+
1. **Initial State**: An operator bundle (v1.0) supports only `OwnNamespace` install mode
48+
2. **Installation**: User installs the operator without explicit `watchNamespace` configuration
49+
3. **Bundle Update**: Operator author releases bundle (v1.1) that adds `AllNamespaces` support alongside existing `OwnNamespace` support
50+
4. **Unintended Behavior**: Without proper validation, the system could automatically switch from `OwnNamespace` to `AllNamespaces` mode during upgrade, granting the operator cluster-wide permissions without user consent
51+
52+
This behavior is problematic because:
53+
- **Security Implications**: Operators suddenly gain broader permissions than originally intended
54+
- **Predictability**: Install mode changes occur without explicit administrator action
55+
- **Consistency**: The same bundle configuration produces different permission scopes across versions
56+
57+
To address this edge case, the implementation requires explicit `watchNamespace` configuration for namespace-scoped bundles (those not supporting `AllNamespaces` mode), ensuring that install mode selection is always deliberate and consistent across bundle upgrades.
58+
4259
### User Stories
4360

4461
#### Story 1: Legacy Operator Migration
@@ -47,6 +64,9 @@ As a cluster administrator migrating from OLM v0 to OLM v1, I want to install op
4764
#### Story 2: Operator Author Requirements
4865
As an operator developer, I have existing registry+v1 bundles that only support Single or OwnNamespace install modes, and I want my customers to be able to deploy these operators in OpenShift with OLM v1 so that the bundle content can be properly rendered and installed without requiring me to modify my existing bundle format during the migration to OLM v1.
4966

67+
#### Story 3: Install Mode Consistency Across Upgrades
68+
As a cluster administrator, I want to ensure that when I install an operator in a specific install mode (e.g., OwnNamespace), subsequent bundle upgrades that add new install mode capabilities (e.g., AllNamespaces) do not automatically change the install mode without my explicit consent, so that my operator's permission scope remains predictable and secure across versions.
69+
5070
### Goals
5171

5272
- Enable installation of registry+v1 bundles that only support SingleNamespace or OwnNamespace install modes
@@ -88,12 +108,12 @@ Update the OLMv1 operator-controller to support rendering registry+v1 bundles wi
88108
| AllNamespaces | SingleNamespace | OwnNamespace | WatchNamespace Configuration |
89109
|---------------|-----------------|--------------|------------------------------------------------------------------|
90110
| - | - | - | undefined/error (no supported install modes) |
91-
| - | - || no configuration |
111+
| - | - || required (must be install namespace) |
92112
| - || - | required (must not be install namespace) |
93-
| - ||| optional (default: install namespace) |
94-
|| - | - | no configuration |
95-
|| - || optional. If set, must be install namespace (default: unset) |
96-
||| - | optional. If set, must NOT be install namespace (default: unset) |
113+
| - ||| required (must specify target namespace) |
114+
|| - | - | no configuration |
115+
|| - || optional. If set, must be install namespace (default: unset) |
116+
||| - | optional. If set, must NOT be install namespace (default: unset) |
97117
|||| optional (default: unset) |
98118

99119
Add support for namespace-scoped operation by ensuring:
@@ -119,13 +139,18 @@ Ensure parity with OLMv0 behavior by:
119139
- `spec.namespace`: The installation namespace where the operator pod will run
120140
- `spec.config.inline.watchNamespace`: The namespace the operator should watch for resources
121141

122-
A scenario exists where the user must specify the watch namespace. Example workflow of a bundle that will require the watch namespace to be specified:
142+
For bundles that only support namespace-scoped install modes (SingleNamespace and/or OwnNamespace, but not AllNamespaces), the `watchNamespace` configuration is **required**. Example workflow:
123143

124-
1. User creates ClusterExtension for a bundle that only supportes SingleNamespace install mode but does not specify the watchNamespace
144+
1. User creates ClusterExtension for a bundle that only supports SingleNamespace or OwnNamespace install mode but does not specify the watchNamespace
125145
2. ClusterExtension does not install. The `Installing` and `Progressing` conditions will be set to false with an error that indicates the required `watchNamespace` is not specified
126-
3. User updates the ClusterExtension specifying the `watchNamespace` configuration to be an exiting namespace on the cluster
146+
3. User updates the ClusterExtension specifying the `watchNamespace` configuration to be an existing namespace on the cluster
127147
4. ClusterExtension installs successfully
128148

149+
This mandatory configuration requirement ensures that:
150+
- Install mode selection is always explicit for namespace-scoped operators
151+
- Bundle upgrades that add AllNamespaces support cannot automatically change the install mode
152+
- Administrators maintain control over operator permission scope across all bundle versions
153+
129154
```
130155
Note: Once a ClusterExtension is already installed, OLM will not prevent the `watchNamespace` parameter from being changed by the admin. OLM will reconcile again with the new parameter, however, whether the operator will then re-install successfully is dependent on the operator itself.
131156
```
@@ -262,25 +287,25 @@ The system determines the actual install mode based on the bundle's supported in
262287
|-------------------------|--------------------------|-----------------------|-----------|
263288
| AllNamespaces only | Not specified | AllNamespaces | Default behavior, no namespace scoping |
264289
| AllNamespaces only | Specified | Error | Bundle doesn't support namespace-scoped installation |
265-
| SingleNamespace only | Not specified | OwnNamespace | Default to most restrictive supported mode |
290+
| SingleNamespace only | Not specified | Error | watchNamespace required for namespace-scoped bundles |
266291
| SingleNamespace only | Specified (≠ install ns) | SingleNamespace | User's explicit choice, bundle supports it |
267292
| SingleNamespace only | Specified (= install ns) | Error | SingleNamespace cannot watch its own install namespace |
268-
| OwnNamespace only | Not specified | OwnNamespace | Use the only supported mode |
293+
| OwnNamespace only | Not specified | Error | watchNamespace required for namespace-scoped bundles |
269294
| OwnNamespace only | Specified (= install ns) | OwnNamespace | Explicit choice matches supported mode |
270295
| OwnNamespace only | Specified (≠ install ns) | Error | OwnNamespace can only watch install namespace |
271-
| Single + Own | Not specified | OwnNamespace | Default to more restrictive mode |
296+
| Single + Own | Not specified | Error | watchNamespace required for namespace-scoped bundles |
272297
| Single + Own | Specified (= install ns) | OwnNamespace | Namespace relationship determines mode |
273298
| Single + Own | Specified (≠ install ns) | SingleNamespace | Namespace relationship determines mode |
274299
| All + Single + Own | Not specified | AllNamespaces | Default to least restrictive mode for compatibility |
275300
| All + Single + Own | Specified (= install ns) | OwnNamespace | Namespace relationship determines mode |
276301
| All + Single + Own | Specified (≠ install ns) | SingleNamespace | Namespace relationship determines mode |
277302
278303
Default Mode Selection Rules are as follows:
279-
1. No watchNamespace specified: Use the most permissive mode supported by the bundle (AllNamespaces > OwnNamespace >
280-
SingleNamespace)
281-
2. watchNamespace = install namespace: Use OwnNamespace mode if supported, otherwise error
282-
3. watchNamespace ≠ install namespace: Use SingleNamespace mode if supported, otherwise error
283-
4. Unsupported mode requested: Installation fails with clear error message indicating supported modes
304+
1. **AllNamespaces-capable bundles**: When no `watchNamespace` is specified, default to `AllNamespaces` mode for maximum compatibility
305+
2. **Namespace-scoped bundles**: When bundles only support `SingleNamespace`/`OwnNamespace` modes, `watchNamespace` configuration is **required** to prevent implicit install mode changes during bundle upgrades
306+
3. **watchNamespace = install namespace**: Use `OwnNamespace` mode if supported, otherwise error
307+
4. **watchNamespace ≠ install namespace**: Use `SingleNamespace` mode if supported, otherwise error
308+
5. **Unsupported mode requested**: Installation fails with clear error message indicating supported modes
284309
285310
The relevant generated resources will be:
286311
- Role/RoleBinding resources for namespace-scoped permissions in Single/OwnNamespace modes
@@ -310,6 +335,7 @@ Because we are enabling namespace-scoped operator installations, there are opera
310335
- **Namespace Dependency**: Clear error messages when target namespaces don't exist or aren't accessible
311336
- **Migration Complexity**: Comprehensive documentation and examples for transitioning between install modes
312337
- **Permission Escalation**: ServiceAccount validation ensures adequate permissions without over-privileging
338+
- **Unintended Install Mode Changes**: Requiring explicit `watchNamespace` configuration for namespace-scoped bundles prevents automatic permission scope escalation when bundle upgrades add new install mode capabilities
313339
314340
Currently, admins control the scope of operator installations through ClusterExtension RBAC. This enhancement adds namespace-level controls while maintaining existing security boundaries.
315341
@@ -327,6 +353,7 @@ Operators installed in Single/OwnNamespace modes have reduced blast radius compa
327353
| **Installation Failures** | Medium | Detailed preflight checks and validation; clear error reporting |
328354
| **Security Boundaries** | Medium | Explicit validation of namespace permissions; RBAC properly scoped |
329355
| **Feature Proliferation** | Low | Clear documentation that this is for legacy compatibility only |
356+
| **Unintended Install Mode Changes** | High | Mandatory `watchNamespace` configuration for namespace-scoped bundles prevents automatic mode switching during upgrades |
330357
331358
### Drawbacks
332359
@@ -373,8 +400,8 @@ Operators installed in Single/OwnNamespace modes have reduced blast radius compa
373400
- **Permission Validation**: Verify ServiceAccount permission requirements
374401
375402
### Regression Tests
376-
- **Conversion Compatibility**: Ensure generated manifests match OLM v0 output for equivalent configurations
377-
- **Feature Gate Toggle**: Verify behavior when feature gate is disabled
403+
404+
NA
378405
379406
### Test Data
380407
https://github.com/openshift/operator-framework-operator-controller will include comprehensive test data in `/test/regression/convert/testdata/expected-manifests/` with separate directories for each install mode, providing reference manifests for validation.
@@ -400,14 +427,21 @@ NA
400427
## Upgrade / Downgrade Strategy
401428
402429
### Upgrade Strategy
403-
- **Feature Gate Dependency**: Feature must be enabled via feature gate before configuration can be used
404-
- **Backward Compatibility**: Existing AllNamespaces installations continue to work unchanged
405-
- **Configuration Migration**: No automatic migration; users must explicitly install using OLMv1 ClusterExtension and configure `watchNamespace`
430+
431+
- **Backward Compatibility**: Existing AllNamespaces installations with OLMv0 will continue to work unchanged.
432+
- **Configuration Migration**: No automatic migration from installalled workloads currently being managed by OLMv0; users must explicitly install using OLMv1 ClusterExtension and configure `watchNamespace`.
406433
407434
### Downgrade Strategy
408-
- **Feature Gate Disable**: Disabling the feature gate prevents new Single/OwnNamespace installations
409-
- **Existing Installations**: Already-installed Single/OwnNamespace operators continue to function
410-
- **Configuration Removal**: Removing `watchNamespace` configuration reverts to AllNamespaces mode on next reconciliation
435+
436+
Downgrading Openshift without removing the field would lead to the field being preserved but ignored because of the following configuration of the `.spec.config` field:
437+
438+
```
439+
inline:
440+
type: object
441+
x-kubernetes-preserve-unknown-fields: true
442+
```
443+
444+
However, since the RBAC created for the Extension would remain the same, there will be no change in scope for Extensions already installed.
411445
412446
### Version Compatibility
413447
- **Minimum Version**: Requires OpenShift 4.20+
@@ -429,7 +463,6 @@ NA
429463
- **Operational Impact:**
430464
- Permission debugging requires understanding of install mode impact on RBAC scope
431465
- Security auditing must consider namespace-level vs cluster-level permission grants
432-
- Upgrade scenarios may change RBAC scope if install mode changes
433466
434467
435468
### Impact on Existing SLIs
@@ -445,22 +478,17 @@ With the removal of the install mode concept in olmv1, operator packages that wa
445478
446479
**Installation Time:**
447480
448-
* **Extended Validation Phase:** Additional validation steps for namespace existence, accessibility, and RBAC permissions add latency to the installation process. Each namespace-scoped installation must validate the target namespace and ServiceAccount permissions.
449481
* **RBAC Generation Complexity:** Converting cluster-scoped RBAC to namespace-scoped Role/RoleBinding resources requires additional processing time. Complex operators with extensive permission requirements will see increased installation duration.
450-
* **Cross-Namespace Connectivity Validation:** Single namespace mode requires validation that the operator in the install namespace can access resources in the watch namespace, adding network connectivity checks.
451482
452483
**Operator Availability:**
453484
454-
* **Namespace Isolation Impact:** Operators installed in Single/OwnNamespace modes are more susceptible to namespace-level issues. Namespace deletion, network policies, or resource quotas can impact operator availability in ways that don't affect AllNamespaces operators.
455-
* Example: A network policy blocking cross-namespace communication prevents a SingleNamespace operator from accessing its target resources.
456485
* **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.
457486
* Example: Namespace admin removes critical RoleBinding, causing operator to lose access to required resources.
458487
459488
**Resource Utilization:**
460489
461490
* **RBAC Resource Proliferation:** Each Single/OwnNamespace installation creates namespace-scoped RBAC resources instead of reusing cluster-scoped ones. Multiple operators in different namespaces will create duplicate Role/RoleBinding resources rather than sharing ClusterRole/ClusterRoleBinding resources.
462491
* Example: Installing the same operator in 10 different namespaces creates 10 sets of Role/RoleBinding resources instead of 1 set of ClusterRole/ClusterRoleBinding resources.
463-
* **Namespace Resource Quota Impact:** Operators and their RBAC resources count against namespace resource quotas, potentially causing quota exhaustion that doesn't occur with cluster-scoped installations.
464492
465493
### Possible Failure Modes
466494
@@ -487,11 +515,10 @@ With the removal of the install mode concept in olmv1, operator packages that wa
487515
488516
If there are problems with namespace-scoped operator installations:
489517
490-
1. **Verify Feature Gate**: Ensure `NewOLMOwnSingleNamespace` is enabled
491-
2. **Check Namespace Existence**: Confirm target watch namespace exists and is accessible
492-
3. **Validate ServiceAccount Permissions**: Verify ServiceAccount has required permissions for target namespace
493-
4. **Review Bundle Compatibility**: Confirm bundle CSV supports the requested install mode
494-
5. **Examine RBAC Resources**: Check generated Role/RoleBinding resources are correctly scoped
518+
1. **Check Namespace Existence**: Confirm target watch namespace exists and is accessible
519+
2. **Validate ServiceAccount Permissions**: Verify ServiceAccount has required permissions for target namespace
520+
3. **Review Bundle Compatibility**: Confirm bundle CSV supports the requested install mode
521+
4. **Examine RBAC Resources**: Check generated Role/RoleBinding resources are correctly scoped
495522
496523
Common troubleshooting scenarios:
497524
- **Installation Stuck**: Check namespace availability and ServiceAccount permissions

0 commit comments

Comments
 (0)