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

feature: add volume cleanup behaviour and optimize setup defaults procedure #21

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

ptyin
Copy link
Member

@ptyin ptyin commented Feb 29, 2024

Fixes #16

What this PR does?

This PR aims to provide users choices for retain or delete volumes after deleting CRs. Users can use following configurations to control this behaviour.

# ...
spec:
  # ...
  persistence:
    volumeReclaimPolicy: Delete  # Or "Retain"

How so?

Basically, I added finalizers to CR for controllers to implement asynchronous pre-delete hooks. In this pre-delete hook, I cleanup all binded PVCs and orphaned PVCs as well.

See https://book.kubebuilder.io/reference/using-finalizers to learn the context.

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the POD is rebuilt, whether can bind to the original that PVCs?

@slievrly slievrly merged commit f629513 into apache:master Sep 6, 2024
1 check passed
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.

Allows control of volumn reclaim behaviour for SeataServer
2 participants