Development

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.
  1. QuarksJob
    1. QuarksJob Component
      1. Errand Controller
        1. Watches
        2. Reconciliation
        3. Highlights
      2. Job Controller
        1. Watches
        2. Reconciliation
        3. Highlights
    2. Relationship with the BDPL component
    3. QuarksJob Examples

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.

flow-quarks-job

Figure 1, illustrates the QuarksJob component diagram and the set of controllers it uses.

flow-quarks-job Fig. 1: The QuarksJob component

Errand Controller

errand-controller-flow 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 Update
  • ConfigMaps: Update
  • Secrets: 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

job-controller-flow 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

bdpl-qjob-relationship 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


Last modified May 25, 2021: Fix code display in release docs (2bc24a5)