#1 Global Leader in Data Resilience

How to Clean Up Veeam Kasten for Kubernetes Manual Backups

KB ID: 4619
Product: Veeam Kasten for Kubernetes
Published: 2024-06-14
Last Modified: 2024-06-14
mailbox
Get weekly article updates
By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.

Cheers for trusting us with the spot in your mailbox!

Now you’re less likely to miss what’s been brewing in our knowledge base with this weekly digest

error icon

Oops! Something went wrong.

Please, try again later.

Purpose

This article provides an overview of scenarios where out-of-schedule restorePoints are created and how to identify and remove them.

Cause

With Veeam Kasten for Kubernetes, there are multiple ways to take backups & exports.

  • A manual backup/export from the application menu.
  • A manual policy run with the `Run Once` button.
  • A scheduled policy run.

The outcome of all the above workflows is the same: a local and exported restorePoint is created inVeeam Kasten for Kubernetes, respectively. However, retention is different for each approach.

  • Any restorePoints created as a part of scheduled policy runs follow retention configured in the policy.
  • A manual backup/export run or a manual policy run is retained forever until it is deleted manually.
    Veeam Kasten provides an option to specify the expiration time when the manual backup/export is triggered. These are automatically retired when the expiration time has elapsed.

It is recommended to set expiration time whenever a manual backup/export or policy run is triggered, as it avoids manual intervention.

There might be situations where backup/exports are created before a change in the application or upgrade of infrastructure components. In such situations, these restorePoints would only be retired if manually deleted or the expiration time is elapsed. This needs handling as removing restorepoints over time is easily missed, which could cause capacity issues in the storage.

Solution

Labeling Explanation

Consider the following regarding the methods used to label restorepoints:

  • After a successful backup/export, Veeam Kasten creates the restorePoint with the label including the name of the policy that created it (e.g., k10.kasten.io/policyName).
  • Since a manual backup/export is not policy-driven, no policy label is included. However, if an expiration time was set during the action, that expiration is set as a label (k10.kasten.io/expiresAt) in the restorepointcontent.
  • For the restorepoints which are created using the run once button, Kasten adds the label: k10.kasten.io/isRunNow

Identifying RestorePointContents using Filters

The examples below demonstrate how to use what is known about labeling to accurately identify restorepointcontens that need to be removed.

 

Retiring the manual backup/export from the application menu

The command below can be used to filter restorePointContents without a policyName and without an expiresAt label.

kubectl get restorepointcontents -l '!k10.kasten.io/expiresAt','!k10.kasten.io/policyName'

Example output:

NAME                       CREATED AT
mysql-manualbackup-45zg2   2022-05-19T10:34:26Z

The output of the above command also has a creation timestamp that can be used to find the old ones and delete them.

Retiring the restorepoints from manual policy run with the `Run Once` button.

We can use the labels k10.kasten.io/isRunNow and k10.kasten.io/expiresAt to filter the restorepointcontents that were run manually without an expiration date.

kubectl get restorepointcontents -l k10.kasten.io/isRunNow=true,'!k10.kasten.io/expiresAt'

Example output:

NAME                        CREATED AT
kasten-io-scheduled-b6rkr   2022-05-05T09:16:31Z

The output of restorepointcontents can be used to retire them in a timely manner.

Deleting the restorepointcontents

The following command can be used to delete the restorepointcontents that were manually created:

kubectl delete restorepointcontents <restorePointContentName>

More Information

Automating RestorePointContent Clean Up

The example below can be used in a cronjob to regularly delete such manual restorepoints that are more than a month old.

#delete manually run backups without a policy or an expiration that are more than a month old
kubectl get restorepointcontents -l '!k10.kasten.io/expiresAt','!k10.kasten.io/policyName' |awk '$2 <= "'$(date -d 'last month' -Ins --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs kubectl delete restorepointcontents

#delete AdHoc runOnce backups without an expiration that are more than a month old
kubectl get restorepointcontents -l k10.kasten.io/isRunNow=true,'!k10.kasten.io/expiresAt' |awk '$2 <= "'$(date -d 'last month' -Ins --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs kubectl delete restorepointcontents
The last month mentioned in the above command can be changed to last week or 15 days ago if the restorepoints older than a week or 15 days needs to be filtered and deleted.
To submit feedback regarding this article, please click this link: Send Article Feedback
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.

Spelling error in text

This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply except as noted in our Privacy Policy.
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

Oops! Something went wrong.

Please, try again later.

You have selected too large block!

Please try select less.

KB Feedback/Suggestion

This form is only for KB Feedback/Suggestions, if you need help with the software open a support case

By submitting, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.
This site is protected by hCaptcha and its Privacy Policy and Terms of Service apply except as noted in our Privacy Policy.
Verify your email to continue your product download
We've sent a verification code to:
  • Incorrect verification code. Please try again.
An email with a verification code was just sent to
Didn't receive the code? Click to resend in sec
Didn't receive the code? Click to resend
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

error icon

Oops! Something went wrong.

Please, try again later.