Merge "Adding Ingress for RIC."
[ric-plt/ric-dep.git] / depRicKubernetesOperator / internal / controller / getServiceAccount.go
1 package controller\r
2 \r
3 import (\r
4         corev1 "k8s.io/api/core/v1"\r
5         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"\r
6         "k8s.io/apimachinery/pkg/util/intstr"\r
7 )\r
8 \r
9 func GetServiceAccount() []*corev1.ServiceAccount {\r
10 \r
11         serviceAccount1 := &corev1.ServiceAccount{\r
12                 ObjectMeta: metav1.ObjectMeta{\r
13                         Name:      "svcacct-ricplt-alarmmanager",\r
14                         Namespace: "ricplt",\r
15                 },\r
16                 TypeMeta: metav1.TypeMeta{\r
17                         APIVersion: "v1",\r
18                         Kind:       "ServiceAccount",\r
19                 },\r
20         }\r
21 \r
22         serviceAccount2 := &corev1.ServiceAccount{\r
23                 ObjectMeta: metav1.ObjectMeta{\r
24                         Namespace: "ricplt",\r
25                         Name:      "svcacct-ricplt-appmgr",\r
26                 },\r
27                 TypeMeta: metav1.TypeMeta{\r
28                         APIVersion: "v1",\r
29                         Kind:       "ServiceAccount",\r
30                 },\r
31         }\r
32 \r
33         serviceAccount3 := &corev1.ServiceAccount{\r
34                 ObjectMeta: metav1.ObjectMeta{\r
35                         Labels: map[string]string{\r
36                                 "app.kubernetes.io/instance":   "release-name",\r
37                                 "app.kubernetes.io/managed-by": "Helm",\r
38                                 "app.kubernetes.io/name":       "kong",\r
39                                 "app.kubernetes.io/version":    "1.4",\r
40                                 "helm.sh/chart":                "kong-0.36.6",\r
41                         },\r
42                         Name: "release-name-kong",\r
43                 },\r
44                 TypeMeta: metav1.TypeMeta{\r
45                         APIVersion: "v1",\r
46                         Kind:       "ServiceAccount",\r
47                 },\r
48         }\r
49 \r
50         serviceAccount4 := &corev1.ServiceAccount{\r
51                 ObjectMeta: metav1.ObjectMeta{\r
52                         Annotations: map[string]string{\r
53                                 "helm.sh/hook":               "pre-upgrade",\r
54                                 "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded",\r
55                         },\r
56                         Labels: map[string]string{\r
57                                 "app.kubernetes.io/instance":   "release-name",\r
58                                 "app.kubernetes.io/managed-by": "Helm",\r
59                                 "app.kubernetes.io/name":       "kong",\r
60                                 "app.kubernetes.io/version":    "1.4",\r
61                                 "helm.sh/chart":                "kong-0.36.6",\r
62                         },\r
63                         Name: "release-name-kong",\r
64                 },\r
65                 TypeMeta: metav1.TypeMeta{\r
66                         APIVersion: "v1",\r
67                         Kind:       "ServiceAccount",\r
68                 },\r
69         }\r
70 \r
71         serviceAccount5 := &corev1.ServiceAccount{\r
72                 ObjectMeta: metav1.ObjectMeta{\r
73                         Name:      "svcacct-tiller-ricxapp",\r
74                         Namespace: "ricinfra",\r
75                 },\r
76                 TypeMeta: metav1.TypeMeta{\r
77                         APIVersion: "v1",\r
78                         Kind:       "ServiceAccount",\r
79                 },\r
80         }\r
81 \r
82         serviceAccount6 := &corev1.ServiceAccount{\r
83                 TypeMeta: metav1.TypeMeta{\r
84                         APIVersion: "v1",\r
85                         Kind:       "ServiceAccount",\r
86                 },\r
87                 ObjectMeta: metav1.ObjectMeta{\r
88                         Name:      "tiller-secret-creator-xzhjjg",\r
89                         Namespace: "ricinfra",\r
90                 },\r
91         }\r
92 \r
93         serviceAccount7 := &corev1.ServiceAccount{\r
94                 ObjectMeta: metav1.ObjectMeta{\r
95                         Labels: map[string]string{\r
96                                 "app.kubernetes.io/instance":   "release-name",\r
97                                 "app.kubernetes.io/managed-by": "Helm",\r
98                                 "app.kubernetes.io/name":       "kong",\r
99                                 "app.kubernetes.io/version":    "1.4",\r
100                                 "helm.sh/chart":                "kong-0.36.6",\r
101                         },\r
102                         Name: "release-name-kong",\r
103                 },\r
104                 TypeMeta: metav1.TypeMeta{\r
105                         APIVersion: "v1",\r
106                         Kind:       "ServiceAccount",\r
107                 },\r
108         }\r
109 \r
110         serviceAccount8 := &corev1.ServiceAccount{\r
111                 TypeMeta: metav1.TypeMeta{\r
112                         APIVersion: "v1",\r
113                         Kind:       "ServiceAccount",\r
114                 },\r
115                 ObjectMeta: metav1.ObjectMeta{\r
116                         Annotations: map[string]string{\r
117                                 "helm.sh/hook":               "pre-upgrade",\r
118                                 "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded",\r
119                         },\r
120                         Labels: map[string]string{\r
121                                 "app.kubernetes.io/instance":   "release-name",\r
122                                 "app.kubernetes.io/managed-by": "Helm",\r
123                                 "app.kubernetes.io/name":       "kong",\r
124                                 "app.kubernetes.io/version":    "1.4",\r
125                                 "helm.sh/chart":                "kong-0.36.6",\r
126                         },\r
127                         Name: "release-name-kong",\r
128                 },\r
129         }\r
130 \r
131         serviceAccount9 := &corev1.ServiceAccount{\r
132                 TypeMeta: metav1.TypeMeta{\r
133                         APIVersion: "v1",\r
134                         Kind:       "ServiceAccount",\r
135                 },\r
136                 ObjectMeta: metav1.ObjectMeta{\r
137                         Name:      "svcacct-ricplt-o1mediator",\r
138                         Namespace: "ricplt",\r
139                 },\r
140         }\r
141 \r
142         serviceAccount10 := &corev1.ServiceAccount{\r
143                 ObjectMeta: metav1.ObjectMeta{\r
144                         Name:      "release-name-prometheus-alertmanager",\r
145                         Namespace: "ricplt",\r
146                         Labels: map[string]string{\r
147                                 "component": "alertmanager",\r
148                                 "heritage":  "Helm",\r
149                                 "release":   "release-name",\r
150                                 "app":       "prometheus",\r
151                                 "chart":     "prometheus-11.3.0",\r
152                         },\r
153                 },\r
154                 TypeMeta: metav1.TypeMeta{\r
155                         APIVersion: "v1",\r
156                         Kind:       "ServiceAccount",\r
157                 },\r
158         }\r
159 \r
160         serviceAccount11 := &corev1.ServiceAccount{\r
161                 ObjectMeta: metav1.ObjectMeta{\r
162                         Labels: map[string]string{\r
163                                 "app":       "prometheus",\r
164                                 "chart":     "prometheus-11.3.0",\r
165                                 "component": "server",\r
166                                 "heritage":  "Helm",\r
167                                 "release":   "release-name",\r
168                         },\r
169                         Name:      "release-name-prometheus-server",\r
170                         Namespace: "ricplt",\r
171                 },\r
172                 TypeMeta: metav1.TypeMeta{\r
173                         Kind:       "ServiceAccount",\r
174                         APIVersion: "v1",\r
175                 },\r
176         }\r
177  \r
178         serviceAccount12 := &corev1.ServiceAccount{\r
179                 ObjectMeta: metav1.ObjectMeta{\r
180                         Name: "assigner-sa",\r
181                 },\r
182                 TypeMeta: metav1.TypeMeta{\r
183                         APIVersion: "v1",\r
184                         Kind:       "ServiceAccount",\r
185                 },\r
186         }\r
187 \r
188         return []*corev1.ServiceAccount{serviceAccount1, serviceAccount2, serviceAccount3, serviceAccount4, serviceAccount5, serviceAccount6, serviceAccount7, serviceAccount8, serviceAccount9, serviceAccount10, serviceAccount11, serviceAccount12}\r
189 }