@@ -35,15 +35,15 @@ clients, caches, schemes, etc. Controllers should be Started through the Manage
35
35
Controller
36
36
37
37
Controller implements a Kubernetes API by responding to events (object Create, Update, Delete) and ensuring that
38
- the state specified in the Spec of the object matches the state of the system. This is called a Reconciler .
38
+ the state specified in the Spec of the object matches the state of the system. This is called a reconcile .
39
39
If they do not match, the Controller will create / update / delete objects as needed to make them match.
40
40
41
- Controllers are implemented as worker queues that process reconcile.Requests (requests to Reconciler the
41
+ Controllers are implemented as worker queues that process reconcile.Requests (requests to reconcile the
42
42
state for a specific object).
43
43
44
- Unlike http handlers, Controllers DO NOT handle events directly, but enqueue Requests to eventually Reconciler
44
+ Unlike http handlers, Controllers DO NOT handle events directly, but enqueue Requests to eventually reconcile
45
45
the object. This means the handling of multiple events may be batched together and the full state of the
46
- system must be read for each Reconciler .
46
+ system must be read for each reconcile .
47
47
48
48
* Controllers require a Reconciler to be provided to perform the work pulled from the work queue.
49
49
@@ -65,11 +65,11 @@ Validating webhook is used to validate if an object meets certain requirements.
65
65
Reconciler
66
66
67
67
Reconciler is a function provided to a Controller that may be called at anytime with the Name and Namespace of an object.
68
- When called, Reconciler will ensure that the state of the system matches what is specified in the object at the
69
- time Reconciler is called.
68
+ When called, the Reconciler will ensure that the state of the system matches what is specified in the object at the
69
+ time the Reconciler is called.
70
70
71
71
Example: Reconciler invoked for a ReplicaSet object. The ReplicaSet specifies 5 replicas but only
72
- 3 Pods exist in the system. Reconciler creates 2 more Pods and sets their OwnerReference to point at the
72
+ 3 Pods exist in the system. The Reconciler creates 2 more Pods and sets their OwnerReference to point at the
73
73
ReplicaSet with controller=true.
74
74
75
75
* Reconciler contains all of the business logic of a Controller.
@@ -80,7 +80,7 @@ a mapping (e.g. owner references) that maps the object that triggers the reconci
80
80
81
81
* Reconciler is provided the Name / Namespace of the object to reconcile.
82
82
83
- * Reconciler does not care about the event contents or event type responsible for triggering the Reconciler .
83
+ * Reconciler does not care about the event contents or event type responsible for triggering the reconcile .
84
84
- e.g. it doesn't matter whether a ReplicaSet was created or updated, Reconciler will always compare the number of
85
85
Pods in the system against what is specified in the object at the time it is called.
86
86
@@ -159,7 +159,7 @@ Controller Example
159
159
1.2 Pod (created by ReplicaSet) -> handler.EnqueueRequestForOwnerHandler - enqueue a Request with the
160
160
Owning ReplicaSet Namespace and Name.
161
161
162
- 2. Reconciler ReplicaSet in response to an event
162
+ 2. reconcile ReplicaSet in response to an event
163
163
164
164
2.1 ReplicaSet object created -> Read ReplicaSet, try to read Pods -> if is missing create Pods.
165
165
@@ -169,7 +169,7 @@ Owning ReplicaSet Namespace and Name.
169
169
170
170
Watching and EventHandling
171
171
172
- Controllers may Watch multiple Kinds of objects (e.g. Pods, ReplicaSets and Deployments), but they Reconciler
172
+ Controllers may Watch multiple Kinds of objects (e.g. Pods, ReplicaSets and Deployments), but they reconcile
173
173
only a single Type. When one Type of object must be updated in response to changes in another Type of object,
174
174
an EnqueueRequestFromMapFunc may be used to map events from one type to another. e.g. Respond to a cluster resize
175
175
event (add / delete Node) by re-reconciling all instances of some API.
@@ -189,10 +189,10 @@ Controller Writing Tips
189
189
190
190
Reconciler Runtime Complexity:
191
191
192
- * It is better to write Controllers to perform an O(1) Reconciler N times (e.g. on N different objects) instead of
193
- performing an O(N) Reconciler 1 time (e.g. on a single object which manages N other objects).
192
+ * It is better to write Controllers to perform an O(1) reconcile N times (e.g. on N different objects) instead of
193
+ performing an O(N) reconcile 1 time (e.g. on a single object which manages N other objects).
194
194
195
- * Example: If you need to update all Services in response to a Node being added - Reconciler Services but Watch
195
+ * Example: If you need to update all Services in response to a Node being added - reconcile Services but Watch
196
196
Nodes (transformed to Service object name / Namespaces) instead of Reconciling Nodes and updating Services
197
197
198
198
Event Multiplexing:
0 commit comments