You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: enhancements/olm/single-ownnamespace-enhancement-proposal.md
+66-39Lines changed: 66 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
-
# OLM v1 Single and OwnNamespace Install Mode Support
2
-
1
+
---
3
2
title: single-ownnamespace-enhancement-proposal
4
3
authors:
5
4
- anbhatta
@@ -9,14 +8,16 @@ reviewers:
9
8
approvers:
10
9
- joelanford
11
10
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
13
11
- everettraven
14
12
creation-date: 2025-09-19
15
13
last-updated: 2025-10-21
16
14
tracking-link: # link to the tracking ticket (for example: Jira Feature or Epic ticket) that corresponds to this enhancement
17
15
- https://issues.redhat.com/browse/OPRUN-4133
16
+
---
18
17
19
18
19
+
# OLM v1 Single and OwnNamespace Install Mode Support
20
+
20
21
## Summary
21
22
22
23
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
39
40
40
41
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.
41
42
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
+
42
59
### User Stories
43
60
44
61
#### 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
47
64
#### Story 2: Operator Author Requirements
48
65
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.
49
66
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
+
50
70
### Goals
51
71
52
72
- 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
| ✓ | - | ✓ | optional. If set, must be install namespace (default: unset) |
116
+
| ✓ | ✓ | - | optional. If set, must NOT be install namespace (default: unset) |
97
117
| ✓ | ✓ | ✓ | optional (default: unset) |
98
118
99
119
Add support for namespace-scoped operation by ensuring:
@@ -119,13 +139,18 @@ Ensure parity with OLMv0 behavior by:
119
139
-`spec.namespace`: The installation namespace where the operator pod will run
120
140
-`spec.config.inline.watchNamespace`: The namespace the operator should watch for resources
121
141
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:
123
143
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
125
145
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
127
147
4. ClusterExtension installs successfully
128
148
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
+
129
154
```
130
155
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.
131
156
```
@@ -262,25 +287,25 @@ The system determines the actual install mode based on the bundle's supported in
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
- 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
310
335
- **Namespace Dependency**: Clear error messages when target namespaces don't exist or aren't accessible
311
336
- **Migration Complexity**: Comprehensive documentation and examples for transitioning between install modes
312
337
- **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
313
339
314
340
Currently, admins control the scope of operator installations through ClusterExtension RBAC. This enhancement adds namespace-level controls while maintaining existing security boundaries.
315
341
@@ -327,6 +353,7 @@ Operators installed in Single/OwnNamespace modes have reduced blast radius compa
327
353
| **Installation Failures** | Medium | Detailed preflight checks and validation; clear error reporting |
328
354
| **Security Boundaries** | Medium | Explicit validation of namespace permissions; RBAC properly scoped |
329
355
| **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 |
330
357
331
358
### Drawbacks
332
359
@@ -373,8 +400,8 @@ Operators installed in Single/OwnNamespace modes have reduced blast radius compa
- **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
378
405
379
406
### Test Data
380
407
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
400
427
## Upgrade / Downgrade Strategy
401
428
402
429
### 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`.
406
433
407
434
### 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.
411
445
412
446
### Version Compatibility
413
447
- **Minimum Version**: Requires OpenShift 4.20+
@@ -429,7 +463,6 @@ NA
429
463
- **Operational Impact:**
430
464
- Permission debugging requires understanding of install mode impact on RBAC scope
431
465
- Security auditing must consider namespace-level vs cluster-level permission grants
432
-
- Upgrade scenarios may change RBAC scope if install mode changes
433
466
434
467
435
468
### Impact on Existing SLIs
@@ -445,22 +478,17 @@ With the removal of the install mode concept in olmv1, operator packages that wa
445
478
446
479
**Installation Time:**
447
480
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.
449
-
* **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.
481
+
* **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.
451
482
452
483
**Operator Availability:**
453
484
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.
456
485
* **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.
457
486
* Example: Namespace admin removes critical RoleBinding, causing operator to lose access to required resources.
458
487
459
488
**Resource Utilization:**
460
489
461
490
* **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.
462
491
* 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.
464
492
465
493
### Possible Failure Modes
466
494
@@ -487,11 +515,10 @@ With the removal of the install mode concept in olmv1, operator packages that wa
487
515
488
516
If there are problems with namespace-scoped operator installations:
489
517
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
0 commit comments