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: docs/documentation/features.md
+59-5
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,69 @@ layout: docs
5
5
permalink: /docs/features
6
6
---
7
7
8
-
# Features
8
+
# Features
9
9
10
-
## Controller Registration
10
+
Java Operator SDK is a high level framework and related tooling in order to facilitate implementation of Kubernetes
11
+
operators. The features are by default following the best practices in an opinionated way. However, feature flags and
12
+
other configuration options are provided to fine tune or turn off these features.
11
13
12
-
## Configurations
14
+
## Controller Execution in a Nutshell
13
15
14
-
## Finalizers
16
+
Controller execution is always triggered by an event. Events typically come from the custom resource
17
+
(i.e. custom resource is created, updated or deleted) that the controller is watching, but also from different sources
18
+
(see event sources). When an event is received reconciliation is executed, unless there is already a reconciliation
19
+
happening for a particular custom resource. In other words it is guaranteed by the framework that no concurrent
20
+
reconciliation happens for a custom resource.
15
21
16
-
### When not to Use Finalizers
22
+
After a reconciliation (
23
+
i.e. [ResourceController](https://github.com/java-operator-sdk/java-operator-sdk/blob/master/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ResourceController.java)
24
+
called), a post-processing phase follows, where typically framework checks if:
25
+
26
+
- an exception was thrown during execution, if yes schedules a retry.
27
+
- there are new events received during the controller execution, if yes schedule the execution again.
28
+
- there is an instruction to re-schedule the execution for the future, if yes schedule a timer event with the specified
29
+
delay.
30
+
- if none above, the reconciliation is finished.
31
+
32
+
Briefly, in the hearth of the execution is an eventing system, where events are the triggers of the reconciliation
make sure that a reconciliation happens when a custom resource is instructed to be deleted. Typical case when it's
39
+
useful, when an operator is down (pod not running). Without a finalizer the reconciliation - thus the cleanup
40
+
i.e. [`ResourceController.deleteResource(...)`](https://github.com/java-operator-sdk/java-operator-sdk/blob/master/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ResourceController.java)
41
+
42
+
- would not happen if a custom resource is deleted.
43
+
44
+
Finalizers are automatically added by the framework as the first step, thus when a custom resource is created, but
45
+
before the first reconciliation, the custom resource is updated via a Kubernetes API call. As a result of this update, the
46
+
finalizer will be present. The subsequent event will be received, which will trigger the first reconciliation.
47
+
48
+
The finalizer that is automatically added will be also removed after the `deleteResource` is executed on the controller.
49
+
However, the removal behavior can be further customized, and can be instructed to "not remove yet" - this is useful just
50
+
in some specific corner cases, when there would be a long waiting period for some dependent resource cleanup.
51
+
52
+
The name of the finalizers can be specified, in case it is not, a name will be generated.
53
+
54
+
This behavior can be turned off, so when configured no finalizer will be added or removed.
55
+
See [`@Controller`](https://github.com/java-operator-sdk/java-operator-sdk/blob/master/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/Controller.java)
56
+
annotation for more details.
57
+
58
+
### When not to Use Finalizers?
59
+
60
+
Typically, automated finalizer handling should be turned off, when **all** the cleanup of the dependent resources is
0 commit comments