Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: soft delete #622

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

feat: soft delete #622

wants to merge 10 commits into from

Conversation

iamryanchia
Copy link
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

In the current implementation, the lifecycle of storage data is bound to object in cluster. When an object is deleted in cluster, the associated data in storage will also be cleared.

Events in cluster are retained for one hour by default. As key information for troubleshooting, it is usually hoped that events can be retained for a longer time, which requires karpor to unbind the lifecycle of specific types of resources from cluster.

This PR adds a remainAfterDeleted field in the SyncRegistry CRD to control that a certain type of resources remain in storage after being deleted in cluster.

If the user sets remainAfterDeleted=true for a type of resource, the user needs to delete the associated data in the storage by himself. Karpor only marks deleted=true for storage data when the object is deleted in cluster.

For resources that leave remainAfterDeleted unset (remainAfterDeleted=false), the data in storage will be deleted immediately after the cluster object is deleted.

apiVersion: search.karpor.io/v1beta1
kind: SyncRegistry
metadata:
  name: events-sync-rule
spec:
  clusters:
    - "*"
  syncResources:
    - apiVersion: v1
      resource: events
      trimRefName: for-events
      remainAfterDeleted: true

Which issue(s) this PR fixes:

Fixes #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants