sighupio / fury-distribution

Kubernetes Fury Distribution (Core Modules) - A battle-tested open-source Kubernetes distribution
https://kubernetesfury.com/
BSD 3-Clause "New" or "Revised" License
161 stars 13 forks source link

dr: `spec.distribution.modules.dr.velero.retentionTime` has no effect #266

Open ralgozino opened 3 weeks ago

ralgozino commented 3 weeks ago

The on-premises and kfddistribution schemas have a spec.distribution.modules.dr.velero.retentionTime property, but I could not find any reference to its value being used.

The property was added in this commit: https://github.com/sighupio/fury-distribution/commit/256cfec8c070544b7e45cbf441258a666223b436#diff-2fd7b2dd73284fe7fe4036c4938edcb3e53198d6a9d79bc68d3c23cc54ebe492R1313 of the following PR:

I'm guessing that the idea was to configure MinIO lifecycle policy but that piece is missing.

alessiodionisi commented 4 days ago

After some testing I think it's better to expose the configuration of the Velero schedule TTL (spec.template.ttl): https://velero.io/docs/v1.14/api-types/schedule/. It's universal and not related to Velero backend. WDYT?

ralgozino commented 4 days ago
    # The amount of time before backups created on this schedule are eligible for garbage collection. If not specified,
    # a default value of 30 days will be used.

Nice. Sounds like a better approach.

One doubt though, is the garbage collector enabled by default or should we do something to enable it?

alessiodionisi commented 4 days ago

I think it's always enabled

ralgozino commented 4 days ago

For posterity, I confirm that it is enabled by default and runs every hour (can be changed passing the flag --garbage-collection-frequency to velero's command)

The effects of expiration are not applied immediately, they are applied when the gc-controller runs its reconciliation loop every hour by default. If needed, you can adjust the frequency of the reconciliation loop using the --garbage-collection-frequency flag.

Source: https://velero.io/docs/v1.11/how-velero-works/#set-a-backup-to-expire