Merge "Adding Ingress for RIC."
[ric-plt/ric-dep.git] / depRicKubernetesOperator / internal / controller / getRoleBinding.go
1 package controller\r
2 \r
3 import (\r
4         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"\r
5 )\r
6 \r
7 func GetRoleBinding() []*rbacv1.RoleBinding {\r
8 \r
9         roleBinding1 := &rbacv1.RoleBinding{\r
10                 Subjects: []rbacv1.Subject{\r
11 \r
12                         rbacv1.Subject{\r
13                                 Kind:      "ServiceAccount",\r
14                                 Name:      "svcacct-ricplt-alarmmanager",\r
15                                 Namespace: "ricplt",\r
16                         },\r
17                 },\r
18                 TypeMeta: metav1.TypeMeta{\r
19                         APIVersion: "rbac.authorization.k8s.io/v1",\r
20                         Kind:       "RoleBinding",\r
21                 },\r
22                 ObjectMeta: metav1.ObjectMeta{\r
23                         Name:      "svcacct-ricplt-alarmmanager-ricxapp-podreader",\r
24                         Namespace: "ricxapp",\r
25                 },\r
26                 RoleRef: rbacv1.RoleRef{\r
27                         APIGroup: "rbac.authorization.k8s.io",\r
28                         Kind:     "Role",\r
29                         Name:     "svcacct-ricplt-alarmmanager-ricxapp-podreader",\r
30                 },\r
31         }\r
32 \r
33         roleBinding2 := &rbacv1.RoleBinding{\r
34                 TypeMeta: metav1.TypeMeta{\r
35                         APIVersion: "rbac.authorization.k8s.io/v1",\r
36                         Kind:       "RoleBinding",\r
37                 },\r
38                 ObjectMeta: metav1.ObjectMeta{\r
39                         Labels: map[string]string{\r
40                                 "app.kubernetes.io/instance":   "release-name",\r
41                                 "app.kubernetes.io/managed-by": "Helm",\r
42                                 "app.kubernetes.io/name":       "kong",\r
43                                 "app.kubernetes.io/version":    "1.4",\r
44                                 "helm.sh/chart":                "kong-0.36.6",\r
45                         },\r
46                         Name:      "release-name-kong",\r
47                         Namespace: "ricplt",\r
48                 },\r
49                 RoleRef: rbacv1.RoleRef{\r
50                         APIGroup: "rbac.authorization.k8s.io",\r
51                         Kind:     "Role",\r
52                         Name:     "release-name-kong",\r
53                 },\r
54                 Subjects: []rbacv1.Subject{\r
55 \r
56                         rbacv1.Subject{\r
57                                 Kind:      "ServiceAccount",\r
58                                 Name:      "release-name-kong",\r
59                                 Namespace: "ricplt",\r
60                         },\r
61                 },\r
62         }\r
63 \r
64         roleBinding3 := &rbacv1.RoleBinding{\r
65                 ObjectMeta: metav1.ObjectMeta{\r
66                         Name:      "svcacct-tiller-ricxapp-ricxapp-tiller-base",\r
67                         Namespace: "ricxapp",\r
68                 },\r
69                 RoleRef: rbacv1.RoleRef{\r
70                         APIGroup: "rbac.authorization.k8s.io",\r
71                         Kind:     "Role",\r
72                         Name:     "ricxapp-tiller-base",\r
73                 },\r
74                 Subjects: []rbacv1.Subject{\r
75 \r
76                         rbacv1.Subject{\r
77                                 Kind:      "ServiceAccount",\r
78                                 Name:      "svcacct-tiller-ricxapp",\r
79                                 Namespace: "ricinfra",\r
80                         },\r
81                 },\r
82                 TypeMeta: metav1.TypeMeta{\r
83                         Kind:       "RoleBinding",\r
84                         APIVersion: "rbac.authorization.k8s.io/v1",\r
85                 },\r
86         }\r
87 \r
88         roleBinding4 := &rbacv1.RoleBinding{\r
89                 ObjectMeta: metav1.ObjectMeta{\r
90                         Namespace: "ricinfra",\r
91                         Name:      "svcacct-tiller-ricxapp-ricxapp-tiller-operation",\r
92                 },\r
93                 RoleRef: rbacv1.RoleRef{\r
94                         APIGroup: "rbac.authorization.k8s.io",\r
95                         Kind:     "Role",\r
96                         Name:     "ricxapp-tiller-operation",\r
97                 },\r
98                 Subjects: []rbacv1.Subject{\r
99 \r
100                         rbacv1.Subject{\r
101                                 Kind:      "ServiceAccount",\r
102                                 Name:      "svcacct-tiller-ricxapp",\r
103                                 Namespace: "ricinfra",\r
104                         },\r
105                 },\r
106                 TypeMeta: metav1.TypeMeta{\r
107                         APIVersion: "rbac.authorization.k8s.io/v1",\r
108                         Kind:       "RoleBinding",\r
109                 },\r
110         }\r
111 \r
112         roleBinding5 := &rbacv1.RoleBinding{\r
113                 ObjectMeta: metav1.ObjectMeta{\r
114                         Namespace: "ricxapp",\r
115                         Name:      "svcacct-tiller-ricxapp-ricxapp-tiller-deployer",\r
116                 },\r
117                 RoleRef: rbacv1.RoleRef{\r
118                         Kind:     "Role",\r
119                         Name:     "ricxapp-tiller-deployer",\r
120                         APIGroup: "rbac.authorization.k8s.io",\r
121                 },\r
122                 Subjects: []rbacv1.Subject{\r
123 \r
124                         rbacv1.Subject{\r
125                                 Kind:      "ServiceAccount",\r
126                                 Name:      "svcacct-tiller-ricxapp",\r
127                                 Namespace: "ricinfra",\r
128                         },\r
129                 },\r
130                 TypeMeta: metav1.TypeMeta{\r
131                         APIVersion: "rbac.authorization.k8s.io/v1",\r
132                         Kind:       "RoleBinding",\r
133                 },\r
134         }\r
135 \r
136         roleBinding6 := &rbacv1.RoleBinding{\r
137                 TypeMeta: metav1.TypeMeta{\r
138                         APIVersion: "rbac.authorization.k8s.io/v1",\r
139                         Kind:       "RoleBinding",\r
140                 },\r
141                 ObjectMeta: metav1.ObjectMeta{\r
142                         Namespace: "ricinfra",\r
143                         Name:      "tiller-secret-creator-xzhjjg-secret-create",\r
144                 },\r
145                 RoleRef: rbacv1.RoleRef{\r
146                         APIGroup: "rbac.authorization.k8s.io",\r
147                         Kind:     "Role",\r
148                         Name:     "tiller-secret-creator-xzhjjg-secret-create",\r
149                 },\r
150                 Subjects: []rbacv1.Subject{\r
151 \r
152                         rbacv1.Subject{\r
153                                 Kind:      "ServiceAccount",\r
154                                 Name:      "tiller-secret-creator-xzhjjg",\r
155                                 Namespace: "ricinfra",\r
156                         },\r
157                 },\r
158         }\r
159 \r
160         roleBinding7 := &rbacv1.RoleBinding{\r
161                 ObjectMeta: metav1.ObjectMeta{\r
162                         Labels: map[string]string{\r
163                                 "app.kubernetes.io/instance":   "release-name",\r
164                                 "app.kubernetes.io/managed-by": "Helm",\r
165                                 "app.kubernetes.io/name":       "kong",\r
166                                 "app.kubernetes.io/version":    "1.4",\r
167                                 "helm.sh/chart":                "kong-0.36.6",\r
168                         },\r
169                         Name:      "release-name-kong",\r
170                         Namespace: "ricplt",\r
171                 },\r
172                 RoleRef: rbacv1.RoleRef{\r
173                         Name:     "release-name-kong",\r
174                         APIGroup: "rbac.authorization.k8s.io",\r
175                         Kind:     "Role",\r
176                 },\r
177                 Subjects: []rbacv1.Subject{\r
178 \r
179                         rbacv1.Subject{\r
180                                 Namespace: "ricplt",\r
181                                 Kind:      "ServiceAccount",\r
182                                 Name:      "release-name-kong",\r
183                         },\r
184                 },\r
185                 TypeMeta: metav1.TypeMeta{\r
186                         APIVersion: "rbac.authorization.k8s.io/v1",\r
187                         Kind:       "RoleBinding",\r
188                 },\r
189         }\r
190 \r
191         roleBinding8 := &rbacv1.RoleBinding{\r
192                 Subjects: []rbacv1.Subject{\r
193 \r
194                         rbacv1.Subject{\r
195                                 Kind:      "ServiceAccount",\r
196                                 Name:      "svcacct-ricplt-o1mediator",\r
197                                 Namespace: "ricplt",\r
198                         },\r
199                 },\r
200                 TypeMeta: metav1.TypeMeta{\r
201                         APIVersion: "rbac.authorization.k8s.io/v1",\r
202                         Kind:       "RoleBinding",\r
203                 },\r
204                 ObjectMeta: metav1.ObjectMeta{\r
205                         Name:      "svcacct-ricplt-o1mediator-ricxapp-podreader",\r
206                         Namespace: "ricxapp",\r
207                 },\r
208                 RoleRef: rbacv1.RoleRef{\r
209                         APIGroup: "rbac.authorization.k8s.io",\r
210                         Kind:     "Role",\r
211                         Name:     "svcacct-ricplt-o1mediator-ricxapp-podreader",\r
212                 },\r
213         }\r
214 \r
215         roleBinding9 := &rbacv1.RoleBinding{\r
216                 Subjects: []rbacv1.Subject{\r
217 \r
218                         rbacv1.Subject{\r
219                                 Kind: "ServiceAccount",\r
220                                 Name: "assigner-sa",\r
221                         },\r
222                 },\r
223                 TypeMeta: metav1.TypeMeta{\r
224                         APIVersion: "rbac.authorization.k8s.io/v1",\r
225                         Kind:       "RoleBinding",\r
226                 },\r
227                 ObjectMeta: metav1.ObjectMeta{\r
228                         Name: "assigner-rb",\r
229                 },\r
230                 RoleRef: rbacv1.RoleRef{\r
231                         APIGroup: "rbac.authorization.k8s.io",\r
232                         Kind:     "Role",\r
233                         Name:     "assigner-role",\r
234                 },\r
235         }\r
236 \r
237         return []*rbacv1.RoleBinding{roleBinding1, roleBinding2, roleBinding3, roleBinding4, roleBinding5, roleBinding6, roleBinding7, roleBinding8, roleBinding9}\r
238 }\r