MedusaBackups not deleted automatically

We operate a K8ssandra-operator based installation and created a MedusaBackupSchedule

k get MedusaBackupSchedule medusa-backup-daily-schedule -oyaml
apiVersion: medusa.k8ssandra.io/v1alpha1
kind: MedusaBackupSchedule
metadata:
  annotations:
    meta.helm.sh/release-name: k8ssandra-resources
    meta.helm.sh/release-namespace: k8ssandra-operator
  creationTimestamp: "2023-08-03T09:37:43Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: medusa-backup-daily-schedule
  namespace: k8ssandra-operator
spec:
  backupSpec:
    backupType: differential
    cassandraDatacenter: dc2
  cronSchedule: 55 2 * * *
  disabled: false
status:
  lastExecution: "2023-09-28T02:55:00Z"
  nextSchedule: "2023-09-29T02:55:00Z"

where we have declared at K8ssandraCluster the following

spec:
    medusa:
      cassandraUserSecretRef:
        name: dbpddaccluster-medusa
      storageProperties:
        bucketName: k8ssandra-prd-backups
        concurrentTransfers: 1
        maxBackupAge: 7
        maxBackupCount: 10

My expectation was that backups would be deleted automatically, but we are as of today at 55 backups

$ kubectl get MedusaBackups | grep medusa-backup-daily-schedule | wc -l
55

Didn’t we got the backup concept right? If someone could point me to the right direction I would be very pleased.

Greetings, Manfred

Hi @acki,

Purge has (still) to be run separately. We will probably add an automated schedule for this at some point.

Here’s how you can create a purge MedusaTask:

apiVersion: medusa.k8ssandra.io/v1alpha1
kind: MedusaTask
metadata:
  name: purge-backups
  namespace: k8ssandra-operator
spec:
  cassandraDatacenter: dc1
  operation: purge

Check here for more explanation, or if you want to see how to create a CronJob for automating purge runs.

1 Like