operator-lifecycle-manager icon indicating copy to clipboard operation
operator-lifecycle-manager copied to clipboard

Support of aggregated ClusterRoles in ClusterServiceVersion

Open houshengbo opened this issue 3 years ago • 3 comments

Feature Request

Is your feature request related to a problem? Please describe. ClusterServiceVersion currently only supports specific rules. I submitted an operator to operatorhub with the aggregated ClusterRoles. It turned to be that I had to convert the aggregated ClusterRoles into the specific rules one by one in the ClusterServiceVersion yaml file.

Describe the solution you'd like It will be very handy if ClusterServiceVersion adds the support of the aggregated ClusterRoles.

One example of the aggregated ClusterRoles:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: monitoring
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
      rbac.example.com/aggregate-to-monitoring: "true"
rules: [] # The control plane automatically fills in the rules

houshengbo avatar Apr 28 '22 19:04 houshengbo

@akihikokuroda @bradtopol What do you think?

houshengbo avatar May 11 '22 17:05 houshengbo

This is currently what we support:

spec:
  install:
    spec:
      clusterPermissions:
      - rules:
        - apiGroups:
          - operator.knative.dev
          resources:
          - '*'
          verbs:
          - '*'
        serviceAccountName: knative-operator

After adding the support of the aggregated cluster roles:

spec:
  install:
    spec:
      clusterPermissions:
      - rules:
        - apiGroups:
          - operator.knative.dev
          resources:
          - '*'
          verbs:
          - '*'
       - aggregationRules:
          - aggregationRule:
              clusterRoleSelectors:
              - matchExpressions:
                 - key: app.kubernetes.io/name
                 operator: In
                 values:
                 - knative-eventing
         serviceAccountName: knative-operator

houshengbo avatar May 12 '22 16:05 houshengbo

Similar to #2039 -- this is something that we would like to tackle in the new version of the OLM v2 APIs.

exdx avatar May 12 '22 19:05 exdx