Documentation for adding a new backup CronJob to an Integreatly instance.
Currently, we have a backup image
that can perform generic backups for a number of components such as MySQL
,
Redis
and Postgres
. If there is a new component type that needs to be
backed-up, it should be added to this image by adding a new script into
image/tools/lib/component/
.
The name of the script is important, as it will be referenced in the CronJob spec to define what type of backup should be performed in the Job.
For a detailed description of how the default backup CronJob template is used, see the documentation.
Adding a new backup CronJob can be done either in the Integreatly installation Ansible scripts or in the Operators for a service.
When adding a CronJob through the installer, a backup.yml
task file should be
added to the component. This backup.yml
file should follow the same pattern
as other existing components e.g. 3scale
with any shared logic being kept in the Backup Role.
When adding a CronJob through an operator, it can follow the pattern from the Keycloak Operator.
In order for the CronJob and the Jobs that it creates to be monitored correctly a number of steps must be done:
- The CronJob and the Job it creates must have a label
monitoring-key: middleware
. This allows us to filter out any CronJobs that aren't related to Integreatly. - The Job that the CronJob creates must also have a label
cronjob-name: <cronjob>
, where<cronjob>
is thename
of the parent CronJob. This allows us to link Jobs to their CronJobs. - The CronJob must be added to the
backup_expected_cronjobs
var in thebackup
role of the installer, regardless of where the CronJob is created.