1+ # The clusterDecisionResource generator in ApplicationSets requires the
2+ # ApplicationSet controller to read ACM PlacementDecisions. The GitOps
3+ # operator does not grant this by default.
14---
25apiVersion : rbac.authorization.k8s.io/v1
36kind : ClusterRole
1518 - list
1619 - watch
1720---
21+ # Bind to openshift-gitops ApplicationSet controller
1822apiVersion : rbac.authorization.k8s.io/v1
1923kind : ClusterRoleBinding
2024metadata :
@@ -30,6 +34,8 @@ subjects:
3034 name : cluster-gitops-applicationset-controller
3135 namespace : openshift-gitops
3236---
37+ # Bind to application-gitops ApplicationSet controller so team
38+ # ApplicationSets in *-team namespaces can use clusterDecisionResource
3339apiVersion : rbac.authorization.k8s.io/v1
3440kind : ClusterRoleBinding
3541metadata :
@@ -44,3 +50,40 @@ subjects:
4450- kind : ServiceAccount
4551 name : application-gitops-applicationset-controller
4652 namespace : application-gitops
53+ ---
54+ # When applicationSet.sourceNamespaces is set on the ArgoCD CR, the
55+ # ApplicationSet controller needs cluster-scoped read access to AppProjects
56+ # to validate project membership across namespaces. The OpenShift GitOps
57+ # operator does not add this to the controller's ClusterRole automatically.
58+ apiVersion : rbac.authorization.k8s.io/v1
59+ kind : ClusterRole
60+ metadata :
61+ name : applicationset-appproject-reader
62+ annotations :
63+ argocd.argoproj.io/sync-wave : " 10"
64+ rules :
65+ - apiGroups :
66+ - argoproj.io
67+ resources :
68+ - appprojects
69+ verbs :
70+ - get
71+ - list
72+ - watch
73+ ---
74+ # Bind to application-gitops ApplicationSet controller which has
75+ # applicationSet.sourceNamespaces: ["*-team", "application-gitops"]
76+ apiVersion : rbac.authorization.k8s.io/v1
77+ kind : ClusterRoleBinding
78+ metadata :
79+ name : application-gitops-applicationset-appproject-reader
80+ annotations :
81+ argocd.argoproj.io/sync-wave : " 10"
82+ roleRef :
83+ apiGroup : rbac.authorization.k8s.io
84+ kind : ClusterRole
85+ name : applicationset-appproject-reader
86+ subjects :
87+ - kind : ServiceAccount
88+ name : application-gitops-applicationset-controller
89+ namespace : application-gitops
0 commit comments