[DM-48286] Automate Chronograf and kapacitor backups #4042
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Chronograf and Kapacitor don’t have an application level backup tool.
An alternative is to backup their PVs or specifically the BoltDB file which holds all the application configuration including dashboards in the case of Chronograf and alert rules in the case of kapacitor.
One complication is that we cannot mount their PVs in the
sasquatch-backup
Pod because they are ReadWriteOnce.We investigated using kubernetes Volume Snaphots which could be a good option for backups in all our environments, but that's not currently available at USDF and our Telescope environments. Velero could be perhaps the best option but that's a larger project.
A more pragmatic solution is to use the kubectl tool to copy the BoltDB file from the application, and this approach works in all environments.
This PR adds Chronograf and Kapacitor backups to the Sasquatch backup CronJob using the kubectl tool copy the relevant files and implements an optional backup retention parameter.
The output from the backup Job looks like:
The PR that adds Chronograf and Kapacitor backups to the backup script is lsst-sqre/sasquatch#52