java-operator-sdk icon indicating copy to clipboard operation
java-operator-sdk copied to clipboard

Generate Kubernetes Resource a.k.a. RBAC

Open csviri opened this issue 2 years ago • 4 comments

First we should investigate how complex this would be, since we would need a different approach that is now in Quarkus Operator SDK

csviri avatar Feb 10 '23 11:02 csviri

Personally, I think the SDK should focus on core functionality (and there's still a bit to do there) and leverage other tools fore additional support. Supporting RBAC/OLM generation at the SDK level would be quite an undertaking because none of the infrastructure needed for it exists.

metacosm avatar Feb 10 '23 12:02 metacosm

none of the infrastructure needed for it exists

what do you mean by this exactly?

I see couple of options:

  • If dependent resources used, it can be generated from that
  • We could introduce registering informers with annotations (this would make also managed dependent resources nicer, when sharing event source). And generate basic rback from that.
  • We could simply introduce dedicated annotation for this, just like in kubebuilder: https://book.kubebuilder.io/reference/markers/rbac.html

csviri avatar Feb 22 '23 12:02 csviri

I really like Quarkus, but I think it's not ideal that some very useful features require using Quarkus. In an ideal world (and I know that this completely neglects the required effort for this), rbac-generation would be available as an additional dependency, like the crd-generator. This way, it would not be part of the core-SDK, but as a 'plugin'.

LucaMertens avatar Apr 18 '23 13:04 LucaMertens

It's also worth noting that some of that functionality could be addressed at the operator-sdk plugin level.

metacosm avatar Apr 18 '23 16:04 metacosm