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/content/en/docs/documentation/reconciler.md
+11-15Lines changed: 11 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,23 @@ weight: 45
6
6
## Reconciliation Execution in a Nutshell
7
7
8
8
An event always triggers reconciliation execution. Events typically come from a
9
-
primary resource, most of the time a custom resource, triggered by changes made to that resource
10
-
on the server (e.g. a resource is created, updated, or deleted). Reconciler implementations are
11
-
associated with a given resource type and listen for such events from the Kubernetes API server
9
+
primary resource, usually a custom resource, triggered by changes made to that resource
10
+
on the server (e.g. a resource is created, updated, or deleted) or from secondary resources for which there is a registered event source.
11
+
Reconciler implementations are associated with a given resource type and listen for such events from the Kubernetes API server
12
12
so that they can appropriately react to them. It is, however, possible for secondary sources to
13
-
trigger the reconciliation process. This usually occurs via
13
+
trigger the reconciliation process. This occurs via
14
14
the [event source](#handling-related-events-with-event-sources) mechanism.
15
15
16
-
When we receive an event it triggers the reconciliation, unless a reconciliation is already
17
-
underway for this particular resource. In other words, the framework guarantees that no
18
-
concurrent reconciliation happens for a resource.
16
+
When we receive an event, it triggers the reconciliation unless a reconciliation is already
17
+
underway for this particular resource. In other words, the framework guarantees that no concurrent reconciliation happens for a resource.
19
18
20
19
Once the reconciliation is done, the framework checks if:
21
20
22
21
- an exception was thrown during execution, and if yes, schedules a retry.
23
22
- new events were received during the controller execution; if yes, schedule a new reconciliation.
24
23
- the reconciler results explicitly re-schedules (`UpdateControl.rescheduleAfter(..)`) a reconciliation with a time delay, if yes,
25
24
schedules a timer event with the specific delay.
26
-
- if none above applies, the reconciliation is finished.
25
+
- if none of the above applies, the reconciliation is finished.
27
26
28
27
In summary, the core of the SDK is implemented as an eventing system where events trigger
29
28
reconciliation requests.
@@ -43,7 +42,7 @@ See [Finalizer support](#finalizer-support) for more details.
43
42
44
43
### Using `UpdateControl` and `DeleteControl`
45
44
46
-
These two classes are used to control the outcome or the desired behaviour after the reconciliation.
45
+
These two classes control the outcome or the desired behavior after the reconciliation.
47
46
48
47
The [`UpdateControl`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/UpdateControl.java)
49
48
can instruct the framework to update the status sub-resource of the resource
@@ -71,13 +70,10 @@ without an update:
71
70
}
72
71
```
73
72
74
-
Note, though, that using `EventSources` should be preferred to rescheduling since the
75
-
reconciliation will then be triggered only when needed instead than on a timely basis.
76
-
77
-
Those are the typical use cases of resource updates, however in some cases there it can happen that
78
-
the controller wants to update the resource itself (for example to add annotations) or not perform
79
-
any updates, which is also supported.
73
+
Note, though, that using `EventSources` is the preferred way of scheduling since the
74
+
reconciliation is triggered only when a resource is changed, not on a timely basis.
80
75
76
+
At the end of the reconciliation, you typically update the status sub-resources.
81
77
It is also possible to update both the status and the resource with the `patchResourceAndStatus` method. In this case,
82
78
the resource is updated first followed by the status, using two separate requests to the Kubernetes API.
0 commit comments