aiven/aiven-operator

Feature Request: Option to orphan resources

Closed this issue · 5 comments

We are currently managing lot's of cloud-resources with kubernetes. Most of them with crossplane which supports a concept of a deletion or management policy. In short you can control what happens to the object during certain stages of it's management.
In our use-case, we don't do in-cluster upgrades but do a blue-green deployment instead. This involves at some point deleting all the resources in the cluster.
I tried to find some way in the code which shows that such option is available but i can't find any.

TLDR: It would be nice if the operator could support a concept of orphaning resources instead of deleting them. I would gladly offer my help if someone would give me some pointers :)

Hey. Thanks for the report.
Could you post a few examples please?
And btw, I can't promise anything, but we're excited to start developing crossplane provider too :)

Hey there :) So what i was thinking is this:

apiVersion: aiven.io/v1alpha1
kind: PostgreSQL
metadata:
  name: aiven-pg
spec:
  deletionPolicy: Orphan

or maybe as an annotation. For my untrained eye it looks like it might be easier to implement

apiVersion: aiven.io/v1alpha1
kind: PostgreSQL
metadata:
  name: aiven-pg
  annotations:
    aiven.io/deletion-policy: Orphan

Just realized that i didn't mention: This feature would obviously only make sense if the operator is able to adopt existing objects

I had some time to code something and submitted a pr with my personal account: #513

Hi @tkaesserfm thanks for contributing. We need to dig into this, make some tests and look for edge cases.