@@ -9,10 +9,47 @@ import (
9
9
rbac "k8s.io/kubernetes/pkg/apis/rbac"
10
10
11
11
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
12
+
13
+ // we need the conversions registered for our init block
14
+ _ "github.com/openshift/origin/pkg/authorization/apis/authorization/install"
12
15
)
13
16
14
17
const saRolePrefix = "system:openshift:controller:"
15
18
19
+ const (
20
+ InfraOriginNamespaceServiceAccountName = "origin-namespace-controller"
21
+ InfraServiceAccountControllerServiceAccountName = "serviceaccount-controller"
22
+ InfraServiceAccountPullSecretsControllerServiceAccountName = "serviceaccount-pull-secrets-controller"
23
+ InfraServiceAccountTokensControllerServiceAccountName = "serviceaccount-tokens-controller"
24
+ InfraServiceServingCertServiceAccountName = "service-serving-cert-controller"
25
+ InfraBuildControllerServiceAccountName = "build-controller"
26
+ InfraBuildConfigChangeControllerServiceAccountName = "build-config-change-controller"
27
+ InfraDeploymentConfigControllerServiceAccountName = "deploymentconfig-controller"
28
+ InfraDeploymentTriggerControllerServiceAccountName = "deployment-trigger-controller"
29
+ InfraDeployerControllerServiceAccountName = "deployer-controller"
30
+ InfraImageTriggerControllerServiceAccountName = "image-trigger-controller"
31
+ InfraImageImportControllerServiceAccountName = "image-import-controller"
32
+ InfraSDNControllerServiceAccountName = "sdn-controller"
33
+ InfraClusterQuotaReconciliationControllerServiceAccountName = "cluster-quota-reconciliation-controller"
34
+ InfraUnidlingControllerServiceAccountName = "unidling-controller"
35
+ InfraServiceIngressIPControllerServiceAccountName = "service-ingress-ip-controller"
36
+ InfraPersistentVolumeRecyclerControllerServiceAccountName = "pv-recycler-controller"
37
+ InfraResourceQuotaControllerServiceAccountName = "resourcequota-controller"
38
+
39
+ // template instance controller watches for TemplateInstance object creation
40
+ // and instantiates templates as a result.
41
+ InfraTemplateInstanceControllerServiceAccountName = "template-instance-controller"
42
+
43
+ // template service broker is an open service broker-compliant API
44
+ // implementation which serves up OpenShift templates. It uses the
45
+ // TemplateInstance backend for most of the heavy lifting.
46
+ InfraTemplateServiceBrokerServiceAccountName = "template-service-broker"
47
+
48
+ // This is a special constant which maps to the service account name used by the underlying
49
+ // Kubernetes code, so that we can build out the extra policy required to scale OpenShift resources.
50
+ InfraHorizontalPodAutoscalerControllerServiceAccountName = "horizontal-pod-autoscaler"
51
+ )
52
+
16
53
var (
17
54
// controllerRoles is a slice of roles used for controllers
18
55
controllerRoles = []rbac.ClusterRole {}
@@ -296,6 +333,19 @@ func init() {
296
333
},
297
334
})
298
335
336
+ addControllerRole (rbac.ClusterRole {
337
+ ObjectMeta : metav1.ObjectMeta {Name : saRolePrefix + InfraTemplateServiceBrokerServiceAccountName },
338
+ Rules : []rbac.PolicyRule {
339
+ rbac .NewRule ("create" ).Groups (kAuthzGroup ).Resources ("subjectaccessreviews" ).RuleOrDie (),
340
+ rbac .NewRule ("create" ).Groups (authzGroup ).Resources ("subjectaccessreviews" ).RuleOrDie (),
341
+ rbac .NewRule ("get" , "create" , "update" , "delete" ).Groups (templateGroup ).Resources ("brokertemplateinstances" ).RuleOrDie (),
342
+ rbac .NewRule ("get" , "create" , "delete" , "assign" ).Groups (templateGroup ).Resources ("templateinstances" ).RuleOrDie (),
343
+ rbac .NewRule ("get" , "list" , "create" , "delete" ).Groups (kapiGroup ).Resources ("secrets" ).RuleOrDie (),
344
+ rbac .NewRule ("list" ).Groups (kapiGroup ).Resources ("services" , "configmaps" ).RuleOrDie (),
345
+ rbac .NewRule ("list" ).Groups (routeGroup ).Resources ("routes" ).RuleOrDie (),
346
+ eventsRule (),
347
+ },
348
+ })
299
349
}
300
350
301
351
// ControllerRoles returns the cluster roles used by controllers
0 commit comments