group-sync-operator icon indicating copy to clipboard operation
group-sync-operator copied to clipboard

Service Account Permissions issue

Open klofton-bw opened this issue 3 years ago • 4 comments

We're running into this issue running version 0.0.15 E0204 20:12:52.562925 1 leaderelection.go:325] error retrieving resource lock group-sync-operator/085c249a.redhat.io: configmaps "085c249a.redhat.io" is forbidden: User "system:serviceaccount:group-sync-operator:group-sync-operator-controller-manager" cannot get resource "configmaps" in API group "" in the namespace "group-sync-operator

I'm pretty sure it stems from https://github.com/redhat-cop/group-sync-operator/blob/main/config/rbac/leader_election_role_binding.yaml being hardcoded to look for the service account in the systems namespace.

- kind: ServiceAccount
  name: controller-manager
  namespace: system

There's no way to override this and the helm chart service account has no way to override the service account name or namespace https://github.com/redhat-cop/group-sync-operator/blob/main/config/helmchart/templates/service-account.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: group-sync-operator-controller-manager 

klofton-bw avatar Feb 04 '22 20:02 klofton-bw

@klofton-bw Are you deploying via the OLM?

sabre1041 avatar Feb 07 '22 15:02 sabre1041

I am deploying via Helm

klofton-bw avatar Feb 07 '22 15:02 klofton-bw

Same for me here ! Deploying through helm. Fixed by a workaround by editing the rolebinding to get rid of the systems entry and match the sa name used by the helm deployment. And also the same logic for the clusterrolesbindings

ssgdevops avatar Feb 16 '22 11:02 ssgdevops

Same for me here ! Deploying through helm. Fixed by a workaround by editing the rolebinding to get rid of the systems entry and match the sa name used by the helm deployment. And also the same logic for the clusterrolesbindings

same here, did the same workaround in ClusterRoleBinding "group-sync-operator-manager-rolebinding": subjects:

  • kind: ServiceAccount name: group-sync-operator-controller-manager namespace: group-sync-operator

look1976 avatar Mar 17 '22 11:03 look1976