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
Update README.md to include csvInjector info (#99)
Add additional clarification on the following:
1. It's relationship to the Operator SDK, OLM and OperatorGroups.
2. The new csvInjector capability
3. How to install independently without common services into any Operator namespace.
Copy file name to clipboardExpand all lines: README.md
+70-22Lines changed: 70 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# namespaceScope - Manage operator and operand authority across namespaces
2
2
3
-
This operator automates the extension of operator watch and service account permission scope to other namespaces in an openshift cluster.
3
+
This operator automates the extension of operator watch and service account permission scope to other namespaces in an openshift cluster, which is similar, but complementary to `OperatorGroups` that are available with Operator Lifecycle Manager (OLM). By using the `NamespaceScope` operator with the `Own Namespace``OperatorGroup` install mode, you can more easily manage the security domain of your Operators and the Operand namespaces.
4
4
5
-
The operator runs in the namespace whose operator WATCH statements and roles/rolebindings are to be extended to other namespaces as specified in a NamespaceScope CR.
5
+
The `NamespaceScope`operator runs in the namespace whose operator's `WATCH_NAMESPACES`and `Roles`/`RoleBindings` are to be extended to other namespaces (the Operand namespaces) as specified in a NamespaceScope CR. `WATCH_NAMESPACES` is an enviromental variable that the Operator SDK uses in conjunction with OLM `ClusterServiceVersion` deployment to identify which namespaces to watch. OLM will inject the namespaces into an annotation into the Operator's Deployment resource and then use the downward API to pass those values into the `WATCH_NAMESPACES` environment variable. To avoid conflicts with OLM, the `NamespaceScope` operator instead stores the watched namespace list in a user-configurable `ConfigMap` and the Deployment instead mounts this `ConfigMap` as an environment variable.
6
6
7
7
A sample CR is below:
8
8
@@ -23,26 +23,21 @@ spec:
23
23
# Restart pods with the following labels when the namespace list changes
24
24
restartLabels:
25
25
intent: projected
26
+
27
+
# Automatically inject the configmap into the ClusterServiceVersion, overriding the OLM OperatorGroup membership for those operators that have
28
+
# the nss.operator.ibm.com/managed-operators annotation defined. This annotation is a comma-separate list of OLM operator package names that should
29
+
# be honored. This should include the package of itself and any dependent operators that cannot be annotated (e.g. third-party operators)
30
+
csvInjector:
31
+
enable: true
26
32
```
27
33
28
34
- The **namespaceMembers** contains a list of other namespace in the cluster that:
29
35
- should be watched by operators running in the current namespace
30
-
- to which roles and rolebindings for service accounts in the current namespace should be authorized for service accounts in this namespace
36
+
- to which `Roles` and `RoleBindings` for `ServiceAccounts`in the current namespace should be authorized for `ServiceAccounts` in this namespace
31
37
32
38
- The **namespaceMembers** list ALWAYS contains the current namespace whether specifically listed or not (it is implicit)
33
39
34
-
- The **configmapName** identifies a ConfigMap that is created to contain a common-separated list of the namespaces to be watched in its **namespaces** key. All operators that want to participate in namespace extension should be configured to watch the key on this configmap. An example of this is in the operator deployment fragment below (the latest operator SDK support watching multiple namespaces in a comma-separated list). The configmap is created and maintained ONLY by the NamespaceScope operator.
35
-
36
-
```
37
-
...
38
-
env:
39
-
- name: WATCH_NAMESPACE
40
-
valueFrom:
41
-
configMapKeyRef:
42
-
name: namespace-scope
43
-
key: namespaces
44
-
...
45
-
```
40
+
- The **configmapName** identifies a `ConfigMap` that is created to contain a common-separated list of the namespaces to be watched in its **namespaces** key.
46
41
47
42
- The **restartLabels** list specifies the labels for operator pods that are to be restarted when the namespace-scope list changes so they can reset their WATCH parameters. The default label is "intent=projected". All operator Pods that are configured as above should also be labelled so that the operator will auto-restart them the configmap changes the list of namespaces to watch. An example of this label is below.
48
43
@@ -64,7 +59,26 @@ spec:
64
59
spec:
65
60
...
66
61
```
62
+
- The **csvInjector** (default is false / disabled) automatically modifies any `ClusterServiceVersion` that appears in the current namespace with the `nss.operator.ibm.com/managed-operators` annotation to consume the `NamespaceScope` operator's `ConfigMap` specified by `configmapName` instead of the traditional downward API syntax scaffolded by the Operator SDK, allowing uninstrumented Operators to read the `NamespaceScope` watch namespaces.
67
63
64
+
The following is an example of what is added and overridden in all `ClusterServiceVersion` resources in the namespace:
65
+
66
+
```
67
+
...
68
+
# This annotation must be added to the CSV for injection to occur. Include THIS operator package and any dependant packages.
@@ -137,25 +151,59 @@ When the `NamespaceScope` CR is created/updated, it will:
137
151
```
138
152
139
153
140
-
## How to manually deploy it
154
+
## How to manually deploy the NamespaceScope Operator
141
155
142
156
NOTE: This operator is part of the IBM Common Services and will be automatically installed. Following commands are only applicable when you want to deploy it without IBM Common Services.
143
157
158
+
In this example, the `my-operators` namespace is the namespace that will contain your OLM-Deployed operators:
0 commit comments