Development
Description
The QuarksJob component is a categorization of a set of controllers, under the same group. Inside the QuarksJob component we have a set of 2 controllers together with one separate reconciliation loop per controller.
Figure 1, illustrates the QuarksJob component diagram and the set of controllers it uses.
Fig. 1: The QuarksJob component
Errand Controller
Fig. 2: The Errand controller flow
This is the controller responsible for implementing Errands, this will lead to the generation of a Kubernetes job, in order to complete a task.
Watches in Errand controller
QuarksJob
resources: Create and UpdateConfigMaps
: UpdateSecrets
: Create and Update
Reconciliation in Errand controller
- When an
QuarksJob
instance is generated, it will create an associated Kubernetes Job. - The generation of new Kubernetes Jobs also serves as the trigger for the
Job Controller
, to start the Reconciliation.
Job Controller
Fig. 3: The Job controller flow
This is an auxiliary controller that relies on the Errand Controller output. It will be watching for Kubernetes Jobs that have Succeeded and deletes the job. If the jobpod of the succeeded job has a label delete=pod
, it deletes the job pod too.
Watches in job controller
Jobs
: Succeeded
Reconciliation in job controller
- Deletes succeeded job and its pod.
Relationship with the BDPL component
Fig. 4: Relationship between the BDPL controller and the QuarksJob component
Figure 4 illustrates the interaction of the BOSHDeployment Controller with the Errand Controller and how the output of this one serves as the trigger for the Job Controller.
Examples
See https://github.com/cloudfoundry-incubator/quarks-job/tree/master/docs/examples