Run daily backups of nodepool zk image data

This does local backups of the nodepool zk image image data to
/var/log/nodepool on the nodepool-builders. These hosts don't get
offsite backups but we run mutliple redundant servers. This data isn't
critical as we can start from scratch, but may be useful if we don't
want to go through all that trouble.

Change-Id: I7d150df9c0d9566ef2d32167cea535e29822cfa2
This commit is contained in:
Clark Boylan 2021-09-16 14:12:08 -07:00
parent 6c115cf29e
commit a1cf5b3f6f
1 changed files with 9 additions and 0 deletions

View File

@ -41,3 +41,12 @@
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
- name: Backup nodepool zk image data daily
cron:
name: Backup nodepool zk image data
minute: '{{ 59 | random(seed=inventory_hostname) }}'
hour: '{{ 23 | random(seed=inventory_hostname) }}'
# Note we backup to /var/log/nodepool because that is what we have bind
# mounted in the container and we are operating relative to that context
job: docker exec nodepool-builder-compose_nodepool-builder_1 nodepool export-image-data /var/log/nodepool/nodepool-image-backup.json