operator-framework / operator-controller

A new and improved management framework for extending Kubernetes with Operators
https://operator-framework.github.io/operator-controller/
Apache License 2.0
67 stars 54 forks source link

📖 ServiceAccount conflicts with OLMV1 when deploying existing bundles using OLMV1 #1376

Open rashmi43 opened 3 weeks ago

rashmi43 commented 3 weeks ago

Existing CSV contains: deployment template RBAC ServiceAccount

When deployed as a ClusterExtension the permissions with the deployment are the ones from its CSV. The CE permissions are not added to the deployment. If the service account name is same, there is an conflict when deploying the CE.

Expectation: The ClusterExtension service account and permissions should be propogated to the deployment. Alternatively, the deployment controller serviceAccount should be overwritten with that listed in the ClusterExtension.

joelanford commented 3 weeks ago

When deployed as a ClusterExtension the permissions with the deployment are the ones from its CSV

This is expected. Operator-controller generates a service account for the deployment and RBAC for the service account based on the contents of the CSV in much the same way that OLMv0 does.

The CE permissions are not added to the deployment

This is also expected. The CE service account and the bundle's service accounts are for different purposes.

See https://kubernetes.io/docs/reference/access-authn-authz/rbac/#privilege-escalation-prevention-and-bootstrapping

If the service account name is same, there is an conflict when deploying the CE.

That's correct. The CE service account is used to install/lifecycle bundle content and the deployment service account is used by the controller for the controller to perform its function. They need to be separate.

joelanford commented 3 weeks ago

I think this is working as intended, but perhaps we should beef up our docs (maybe a new concept doc around OLMv1's permissions model) to clarify this intent.

rashmi43 commented 3 weeks ago

I will work with @perdasilva to get a new document around the OLMv1 permission model