Skip to content
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

need ability to specify roleRef in permissions #732

Closed
richm opened this issue Feb 27, 2019 · 5 comments
Closed

need ability to specify roleRef in permissions #732

richm opened this issue Feb 27, 2019 · 5 comments

Comments

@richm
Copy link

richm commented Feb 27, 2019

In the permissions and clusterPermissions sections, I would like to be able to specify a pre-defined role or clusterRole to be used for the permissions of an SA rather than having to expand all of the rules. For example, I would like to be able to say

      clusterPermissions:
      - serviceAccountName: cluster-logging-operator
        roleRefs:
        - cluster-reader
        - ... some other roles ...
        rules:
        - apiGroups:
          - scheduling.k8s.io
          resources:
          - priorityclasses
          verbs:
          - "*"
         ... other additional rules not covered by roles ...

rather than having to manually expand cluster-reader and de-dup the rules (e.g. as in operator-framework/community-operators#112)

@ecordell
Copy link
Member

Hi @richm -

This is possible today in OLM - you can bundle an extra RoleBinding in with your operator (not in the CSV, alongside it) as part of the "operator bundle". You can read a bit more about them here: https://github.com/operator-framework/operator-registry#manifest-format

Unfortunately, community-operators doesn't currently support building operator bundles (as far as I know). Sorry for ping-ponging you back and forth, but I think this should be a feature request against community-operators to support bundles. Happy to hop in a conversation over there to further explain if it's needed.

@richm
Copy link
Author

richm commented Feb 27, 2019

This is possible today in OLM - you can bundle an extra RoleBinding in with your operator (not in the CSV, alongside it) as part of the "operator bundle"

@ecordell can you show me an example of using an extra RoleBinding?

@richm
Copy link
Author

richm commented Feb 27, 2019

Or are you saying that OLM will allow me to just drop in a file like this: https://github.com/openshift/cluster-logging-operator/blob/master/manifests/04-role-binding.yaml#L46

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: cluster-logging-operator-cluster-reader-binding
subjects:
- kind: ServiceAccount
  name: cluster-logging-operator
  namespace: openshift-logging
roleRef:
  kind: ClusterRole
  name: cluster-reader
apiGroup: rbac.authorization.k8s.io

in the directory with https://github.com/operator-framework/community-operators/tree/master/community-operators/cluster-logging alongside the other files like clusterloggings.crd.yaml?

Except that it won't work because https://github.com/operator-framework/community-operators doesn't support this, it won't know how to handle the extra RoleBindings file?

@ecordell
Copy link
Member

@richm That's correct - the issue you're running into is an issue with the pipeline that outputs catalogs, and not with OLM.

With that in mind I'm going to close this issue, since I don't think there's anything that OLM can change to fix this for you. Please re-open if we missed something or can help out otherwise.

JAORMX added a commit to JAORMX/compliance-operator that referenced this issue May 19, 2020
The OLM doesn't allow us to use pre-existing roles/clusterroles, nor
use aggregated roles either. So we need to define the roles explicitly.

See: operator-framework/operator-lifecycle-manager#732
@JAORMX
Copy link

JAORMX commented May 19, 2020

We're stumbling upon this as well :/ any other ways of solving a similar issue? we need a role-binding to a pre-existing role in the cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants