@Sergey Pronin we technically cannot detect that Backup CR was deleted without a finalizer. all that we can do - specify the finalizer in the default template of Backup CR.
Sergey Pronin
April 9, 2021 at 6:46 PM
@Mykola Marzhan@Slava Sarzhan I believe we should not ask user to specify the finalizer. It should be the default behavior to remove backups from S3.
Do you see any use case where the user wants to keep the backup on S3, but remove the k8s object?
Deployed psmdb cluster using:
./anydbver deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-minio k8s-mongo backup
I've created a backup using example:
https://github.com/percona/percona-server-mongodb-operator/blob/main/deploy/backup/backup.yaml
kubectl get psmdb-backup NAME CLUSTER STORAGE DESTINATION STATUS COMPLETED AGE backup1 my-cluster-name minio 2021-04-09T15:02:38Z ready 46s 88s [root@ihanick-default backup]# kubectl exec -it minio-service-6644f9b456-zzcqd -- sh -c 'ls -1 /export/operator-testing/*.pbm.json'
Files are still in minio:
[root@ihanick-default backup]# kubectl delete psmdb-backup backup1 perconaservermongodbbackup.psmdb.percona.com "backup1" deleted [root@ihanick-default backup]# kubectl exec -it minio-service-6644f9b456-zzcqd -- sh -c 'ls -1 /export/operator-testing/*.pbm.json' /export/operator-testing/2021-04-09T15:02:38Z.pbm.json
The backup created from:
apiVersion: psmdb.percona.com/v1 kind: PerconaServerMongoDBBackup metadata: finalizers: - delete-backup name: backup2 spec: psmdbCluster: my-cluster-name storageName: minio
Is deleted as expected from minio.