How do I configure Longhorn backup so it executes some bash scripts in the pod before and after snapshot/backup is taken?
Something similar to Velero's backup hooks.
annotations:
backup.velero.io/backup-volumes: data
pre.hook.backup.velero.io/command: "['/usr/bin/mysql', '-e', '\"flush tables with read lock;\"']"
pre.hook.backup.velero.io/container: mysql
post.hook.backup.velero.io/command: "['/usr/bin/mysql', '-e', '\"unlock tables;\"']"
post.hook.backup.velero.io/container: mysql
Apparently not possible at the moment, according to the longhorn github issue.
You can orchestrate similar behaviour by using volume snapshot
Where
volumesnapshot.yamlis:See example for IRIS database: https://community.intersystems.com/post/amazon-eks-and-iris-high-availability-and-backup