-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement GitRepo Deletion #32
Comments
To discuss:
To figure out:
|
Here's my suggestion: Use recycle policies:
What to delete:
I'd suggest the default policy is archive and if you really want something gone, you'll have to set it explicitly beforehand. |
In K8s PVC it's called
Let's make the default configurable (i.e. on dev we probably want An interesting concept from Hive is delete protection:
So we could add a |
I started with the basic framework to support Also started to implement I like your suggestion with the delete protection annotation. I'll look into it. |
What should the exact meaning of
Yes, but I think before we can implement this one we really need good safeguards as I already see this generating a huge clusterf*ck one day. I did some research how others are doing that kind of stuff, to have a better understanding of it: KubeDBKubeDB also has some concepts regarding deletion: https://kubedb.com/docs/v0.13.0-rc.0/concepts/what-is-kubedb/overview/:
They are calling it It is implemented as a CrossplaneThe are calling it
See https://github.com/crossplane/crossplane/blob/master/design/one-pager-resource-reclaim-policy.md ConclusionI guess the long-term goal should be to try to reuse as much as possible from Crossplane, even replacing parts of the Lieutenant Operator by Crossplane could be an option. But for the time being I think we should still implement it in Lieutenant Operator. |
@tobru yes retain would simply leave the external resources be. I like crossplane's concept a lot, but it might be quite overkill to implement in our lieutenant operator. So is the long-term idea that we (VSHN) will submit code to crossplane as well to "outsource" these kinds of workloads away from our operator(s)? |
I read up on how finalizers are implemented with the operator-sdk, as well as tobru's suggestions. I also started to implement some finalizer logic into the gitrepo reconcile loop. |
Did some plumbing for the finalizer handling. Tested and implemented:
To do:
Also we need to define how we want to handle the annotation to prevent accidental deletions. Should the operator set it on any CR by default? |
I'd say so, yes. But please make it configurable (e.g. |
Started implementing the deletion protection via label. |
While testing the functionality I found some UX issues. When setting the annotation to false on a cluster, it will delete the vault token. But it won't delete the gitrepo, as it's a separate CR. The annotation value should be propagate throughout the chain, if changed. |
Implement the Git repository cleanup process with a retention policy feature (retain, delete) and by leveraging the finalizer pattern for actually deleting repositories.
Task Deliverables
The text was updated successfully, but these errors were encountered: