Deleting a KOTS snapshot in an embedded kURL cluster does not reclaim space on the disk

After I delete a KOTS snapshot in an embedded kURL cluster it does not seem to reclaim space on the disk. How can I reclaim the space?

After deleting a snapshot, the Velero Restic data will remain until the maintenance cron prunes data. This happens once every 7 days. It is scheduled this infrequently because it holds an exclusive lock on the repo making snapshots unavailable while pruning.

It is possible to force Restic to prune the data with the following hack. This will make Restic prune the repos within 5 minutes the next time the cron runs.

kubectl -n velero get resticrepositories -oname \
  | xargs -I{} kubectl -n velero patch {} \
  --type='json' \
  -p '[{"op":"replace", "path":"/status/lastMaintenanceTime", "value":"2020-01-01T00:00:00Z"}]'

It is also possible to run the restic prune command manually.

Run this command if ceph is backing restic:

kubectl -n velero exec -it deploy/velero -- \
  restic -r s3:http://rook-ceph-rgw-rook-ceph-store.rook-ceph/velero/restic/default prune

Or if minio is backing restic:

kubectl -n velero exec -it deploy/velero -- \
  restic -r s3:http://minio.minio/velero/restic/default prune

You will be prompted for a password. You can find the password by running the command:

kubectl -n velero get secret velero-restic-credentials \
  -ojsonpath='{ .data.repository-password }' | base64 --decode