I am implementing a Java service that uses the Java Operator SDK to listen for specific custom resources. I am implementing both Reconciler and Cleaner because I want to get notified even when a CRs is deleted.
The issue is that implementing the Cleaner means that my application changes the CRs to add finalizers. I don't have permission to change the CRs though.
In general, my application simply needs to:
- List the CRs at startup
- Get an event when one of these CRs gets deleted
- No need to do any update to those CRs
Is the Reconciler a suitable pattern for this use case? Should I look at something else?
For this scenario, the operator SDK is not the best choice. Cleaners attempt to add finalizers to the CRs, so it's not an option in my case.
Shared informers, provided by K8s Fabric8, are more than enough and quite easy to implement.