ModelController
Class: ModelController
Defined in: kubernetes/src/operator/controller.ts:100
Reconcile the objects of one model stored in a KubernetesStore
It watches the resources of the model, queues the objects whose spec changed (metadata.generation), runs their
reconcile and writes status.observedGeneration and a Ready condition. Status-only changes, its own status
writes included, are not reconciled again.
Constructors
Constructor
new ModelController(
model,store,options):ModelController
Defined in: kubernetes/src/operator/controller.ts:115
Parameters
model
ModelClass
the model
store
the store of the model
options
queue, resync and finalizer
Returns
ModelController
Properties
attempted
protectedattempted:Map<string,number>
Defined in: kubernetes/src/operator/controller.ts:108
generation of each object last reconciled, successfully or not
filter
protectedfilter:KubernetesRepository<any>
Defined in: kubernetes/src/operator/controller.ts:103
informer?
protectedoptionalinformer?:KubernetesInformer<CustomResource>
Defined in: kubernetes/src/operator/controller.ts:104
model
readonlymodel:ModelClass
Defined in: kubernetes/src/operator/controller.ts:116
the model
options
protectedoptions:ControllerOptions
Defined in: kubernetes/src/operator/controller.ts:118
queue, resync and finalizer
queue?
protectedoptionalqueue?:WorkQueue
Defined in: kubernetes/src/operator/controller.ts:105
repository
protectedrepository:Repository<any>
Defined in: kubernetes/src/operator/controller.ts:102
resources
protectedresources:CustomResources
Defined in: kubernetes/src/operator/controller.ts:101
resyncTimer?
protectedoptionalresyncTimer?:Timeout
Defined in: kubernetes/src/operator/controller.ts:106
store
protectedstore:KubernetesStore
Defined in: kubernetes/src/operator/controller.ts:117
the store of the model
Methods
accepts()
protectedaccepts(resource):boolean
Defined in: kubernetes/src/operator/controller.ts:168
Whether a resource holds an object of the model (subclasses share the resources of their root model)
Parameters
resource
the resource
Returns
boolean
true if it does
enqueue()
protectedenqueue(name):void
Defined in: kubernetes/src/operator/controller.ts:185
Queue an object
Parameters
name
string
the resource name
Returns
void
finalize()
protectedfinalize(resource):Promise<void>
Defined in: kubernetes/src/operator/controller.ts:258
Call finalize of an object being deleted, then remove the finalizer
Parameters
resource
the resource
Returns
Promise<void>
onChange()
protectedonChange(resource):void
Defined in: kubernetes/src/operator/controller.ts:194
Queue a changed object, unless its spec is already reconciled
Parameters
resource
the resource
Returns
void
process()
protectedprocess(name):Promise<WorkResult>
Defined in: kubernetes/src/operator/controller.ts:212
Reconcile or finalize an object
Parameters
name
string
the resource name
Returns
Promise<WorkResult>
the reconcile result
resync()
resync():
void
Defined in: kubernetes/src/operator/controller.ts:175
Queue every object of the model
Returns
void
start()
start():
Promise<void>
Defined in: kubernetes/src/operator/controller.ts:129
Start watching and reconciling
Returns
Promise<void>
once the resources are listed
stop()
stop():
Promise<void>
Defined in: kubernetes/src/operator/controller.ts:155
Stop watching and reconciling
Returns
Promise<void>
once the reconciliations in progress are done
update()
protectedupdate(name,change,status?):Promise<void>
Defined in: kubernetes/src/operator/controller.ts:276
Read, change and replace a resource, again on conflict
Parameters
name
string
the resource name
change
(resource) => boolean
change the resource, false when there is nothing to write
status?
boolean = false
write the status subresource instead of the resource
Returns
Promise<void>
writeStatus()
protectedwriteStatus(name,generation,condition):Promise<void>
Defined in: kubernetes/src/operator/controller.ts:307
Write the observed generation and a condition in the status
Parameters
name
string
the resource name
generation
number
the generation reconciled
condition
Omit<ResourceCondition, "lastTransitionTime" | "observedGeneration">
the condition
Returns
Promise<void>