Skip to content

Commit 662979a

Browse files
docs: add faq non clustered operator (#1548)
* docs: add faq non clustered operator * fix: wording, clarify that annotation can also be used to configure namespaces Co-authored-by: Chris Laprun <[email protected]>
1 parent 0867ef7 commit 662979a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Diff for: docs/documentation/faq.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,32 @@ without an update:
4343
```
4444

4545
Although you might consider using `EventSources`, to handle reconciliation triggering in a smarter
46-
way.
46+
way.
47+
48+
### Q: How can I run an operator without cluster scope rights?
49+
50+
By default, JOSDK requires access to CRs at cluster scope. You may not be granted such
51+
rights and you will see some error at startup that looks like:
52+
53+
```plain
54+
io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.local.svc/apis/mygroup/v1alpha1/mycr. Message: Forbidden! Configured service account doesn't have access. Service account may have been revoked. mycrs.mygroup is forbidden: User "system:serviceaccount:ns:sa" cannot list resource "mycrs" in API group "mygroup" at the cluster scope.
55+
```
56+
57+
To restrict the operator to a set of namespaces, you may override which namespaces are watched by a reconciler
58+
at [Reconciler-level configuration](./configuration.md#reconciler-level-configuration):
59+
60+
```java
61+
Operator operator;
62+
Reconciler reconciler;
63+
...
64+
operator.register(reconciler, configOverrider ->
65+
configOverrider.settingNamespace("mynamespace"));
66+
```
67+
Note that configuring the watched namespaces can also be done using the `@ControllerConfiguration` annotation.
68+
69+
Furthermore, you may not be able to list CRDs at startup which is required when `checkingCRDAndValidateLocalModel`
70+
is `true` (`false` by default). To disable, set it to `false` at [Operator-level configuration](./configuration.md#operator-level-configuration):
71+
72+
```java
73+
ConfigurationServiceProvider.overrideCurrent(o -> o.checkingCRDAndValidateLocalModel(false));
74+
```

0 commit comments

Comments
 (0)