Hi,
- We backup AWX using AWXBackup.
- This results in a PVC and an AWXBackup.
- All PVCs are backed up to another site. The AWXBackup resource is not, and will be lost if complete dataloss/disaster occurs.
Can I run a AWXRestore without the AWXBackup, and only the PVC?
Hope this makes sense! Please tell me if I further details are needed.
$ ka get awxbackup
NAME AGE
awx-backup-2023-10-19-1458 18h
$ ka get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
postgres-13-awx-postgres-13-0 Bound pvc-9b686407-a5d8-4c96-b0e8-4451546fc27a 8Gi RWO longhorn 8d
pvc-awx-backup Bound pvc-e677c5ed-b799-4588-863d-aa0b378bf660 10Gi RWO longhorn 18h
awx-backup.bash
manifest="
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
name: awx-backup-$(date +%Y-%m-%d-%H%M)
namespace: awx
spec:
deployment_name: awx
backup_pvc: pvc-awx-backup
backup_storage_class: longhorn
backup_pvc_namespace: awx
clean_backup_on_delete: true
"
kubectl apply -f - <<< $manifest
awx-restore.bash (this wouldn’t work[?] since the AWXBackup doesn’t exist)
manifest="
apiVersion: awx.ansible.com/v1beta1
kind: AWXRestore
metadata:
name: restore-$1
namespace: awx
spec:
deployment_name: awx
backup_name: $1
backup_pvc_namespace: awx
backup_pvc: pvc-awx-backup
"
kubectl apply -f - <<< $manifest