Automatic Backup (with official role)

Hello,

How could I automatically run daily backup using the role ?
I dont think it is possible to use cronjob object with role ?

Once the awxbackup.yml is executed, the backup works fine, however an object “awxbackup” is created and stays alive in the cluster.
Can someone explain me why this object stays in the cluster since the backup in only executed once when the yaml manifest is applied ?

Here is the official role i am using.
https://github.com/ansible/awx-operator/tree/devel/roles/backup

Any help would much appreciated

Hi,

How could I automatically run daily backup using the role ?
I dont think it is possible to use cronjob object with role ?

There is no official guide, but technically daily backup can be achieved by some way e.g.:

  • Create playbook to take backup and register it as scheduled job on your AWX

F.Y.I., this is my example implementation: https://github.com/kurokobo/awx-on-k3s/tree/main/backup/ansible

  • Create cronjob on your K8s that run playbook or just apply awxbackup.yml to your cluster.

Can someone explain me why this object stays in the cluster since the backup in only executed once when the yaml manifest is applied ?

The AWXBackup can easily be used to restore AWX via “backup_name” for AWXRestore.
https://github.com/ansible/awx-operator/tree/devel/roles/restore
In addition, you can configure AWXBackup so that when it is deleted, the backup data on the PVC is also deleted via “clean_backup_on_delete: true”. So the presence of AWXBackup resources can be used to manage backup generations

Regards,

@kurokobo

Thanks a for your reply.

I forgot to mention that I am using minikube. do you think the playbook method is still an option?

Regards,

-------- Message original --------

Hi,

do you think the playbook method is still an option?

I believe yes, you should try it out :slight_smile:
Please be careful not to accidentally delete PV and PVC that includes backup data, as the playbook does not include tasks to retrieve data stored in PVs on minikube.

Regards,