Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / so / templates / service.yaml
1 {{/*
2 # Copyright © 2018 AT&T USA
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16 apiVersion: v1
17 kind: Service
18 metadata:
19   name: {{ include "common.servicename" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26   annotations:
27     msb.onap.org/service-info: '[
28          {
29         "serviceName": "so",
30         "version": "v1",
31         "url": "/onap/so/infra/cloudResources/{version:[vV][1]}/operationalEnvironments",
32         "protocol": "REST",
33         "port": "{{ .Values.service.internalPort }}",
34         "visualRange":"0",
35         "lb_policy":"ip_hash"
36          },
37          {
38         "serviceName": "so",
39         "version": "v1",
40         "url": "/onap/so/infra/cloudResources/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/activate",
41         "protocol": "REST",
42         "port": "{{ .Values.service.internalPort }}",
43         "visualRange":"0",
44         "lb_policy":"ip_hash"
45          },
46           {
47         "serviceName": "so",
48         "version": "v1",
49         "url": "/onap/so/infra/cloudResources/{version:[vV][1]}/operationalEnvironments/{operationalEnvironmentId}/deactivate",
50         "protocol": "REST",
51         "port": "{{ .Values.service.internalPort }}",
52         "visualRange":"0",
53         "lb_policy":"ip_hash"
54          },
55          {
56         "serviceName": "so",
57         "version": "v1",
58         "url": "/onap/so/infra/cloudResourcesRequests/{version:[vV][1]}/{requestId}/unlock",
59         "protocol": "REST",
60         "port": "{{ .Values.service.internalPort }}",
61         "visualRange":"0",
62         "lb_policy":"ip_hash"
63          },
64          {
65         "serviceName": "so",
66         "version": "v1",
67         "url": "/onap/so/infra/cloudResourcesRequests/{version:[vV][1]}",
68         "protocol": "REST",
69         "port": "{{ .Values.service.internalPort }}",
70         "visualRange":"0",
71         "lb_policy":"ip_hash"
72          },
73           {
74         "serviceName": "so",
75         "version": "v1",
76         "url": "/onap/so/infra/orchestrationRequests/{version:[vV][4-7]}/{requestId}",
77         "protocol": "REST",
78         "port": "{{ .Values.service.internalPort }}",
79         "visualRange":"0",
80         "lb_policy":"ip_hash"
81          },
82           {
83         "serviceName": "so",
84         "version": "v1",
85         "url": "/onap/so/infra/orchestrationRequests/{version:[vV][4-7]}",
86         "protocol": "REST",
87         "port": "{{ .Values.service.internalPort }}",
88         "visualRange":"0",
89         "lb_policy":"ip_hash"
90          },
91           {
92         "serviceName": "so",
93         "version": "v1",
94         "url": "/onap/so/infra/orchestrationRequests/{version:[vV][4-7]}/{requestId}/unlock",
95         "protocol": "REST",
96         "port": "{{ .Values.service.internalPort }}",
97         "visualRange":"0",
98         "lb_policy":"ip_hash"
99          },
100          {
101         "serviceName": "so",
102         "version": "v1",
103         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances",
104         "protocol": "REST",
105         "port": "{{ .Values.service.internalPort }}",
106         "visualRange":"0",
107         "lb_policy":"ip_hash"
108          },
109          {
110         "serviceName": "so",
111         "version": "v1",
112         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/activate",
113         "protocol": "REST",
114         "port": "{{ .Values.service.internalPort }}",
115         "visualRange":"0",
116         "lb_policy":"ip_hash"
117          },
118           {
119         "serviceName": "so",
120         "version": "v1",
121         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/deactivate",
122         "protocol": "REST",
123         "port": "{{ .Values.service.internalPort }}",
124         "visualRange":"0",
125         "lb_policy":"ip_hash"
126          },
127          {
128         "serviceName": "so",
129         "version": "v1",
130         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}",
131         "protocol": "REST",
132         "port": "{{ .Values.service.internalPort }}",
133         "visualRange":"0",
134         "lb_policy":"ip_hash"
135          },
136          {
137         "serviceName": "so",
138         "version": "v1",
139         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][7]}/serviceInstances/assign",
140         "protocol": "REST",
141         "port": "{{ .Values.service.internalPort }}",
142         "visualRange":"0",
143         "lb_policy":"ip_hash"
144          },
145           {
146         "serviceName": "so",
147         "version": "v1",
148         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/unassign",
149         "protocol": "REST",
150         "port": "{{ .Values.service.internalPort }}",
151         "visualRange":"0",
152         "lb_policy":"ip_hash"
153          },
154           {
155         "serviceName": "so",
156         "version": "v1",
157         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations",
158         "protocol": "REST",
159         "port": "{{ .Values.service.internalPort }}",
160         "visualRange":"0",
161         "lb_policy":"ip_hash"
162          },
163           {
164         "serviceName": "so",
165         "version": "v1",
166         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}",
167         "protocol": "REST",
168         "port": "{{ .Values.service.internalPort }}",
169         "visualRange":"0",
170         "lb_policy":"ip_hash"
171          },
172          {
173         "serviceName": "so",
174         "version": "v1",
175         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort",
176         "protocol": "REST",
177         "port": "{{ .Values.service.internalPort }}",
178         "visualRange":"0",
179         "lb_policy":"ip_hash"
180          },
181          {
182         "serviceName": "so",
183         "version": "v1",
184         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort",
185         "protocol": "REST",
186         "port": "{{ .Values.service.internalPort }}",
187         "visualRange":"0",
188         "lb_policy":"ip_hash"
189          },
190           {
191         "serviceName": "so",
192         "version": "v1",
193         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate",
194         "protocol": "REST",
195         "port": "{{ .Values.service.internalPort }}",
196         "visualRange":"0",
197         "lb_policy":"ip_hash"
198          },
199          {
200         "serviceName": "so",
201         "version": "v1",
202         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate",
203         "protocol": "REST",
204         "port": "{{ .Values.service.internalPort }}",
205         "visualRange":"0",
206         "lb_policy":"ip_hash"
207          },
208          {
209         "serviceName": "so",
210         "version": "v1",
211         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/addRelationships",
212         "protocol": "REST",
213         "port": "{{ .Values.service.internalPort }}",
214         "visualRange":"0",
215         "lb_policy":"ip_hash"
216          },
217           {
218         "serviceName": "so",
219         "version": "v1",
220         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/removeRelationships",
221         "protocol": "REST",
222         "port": "{{ .Values.service.internalPort }}",
223         "visualRange":"0",
224         "lb_policy":"ip_hash"
225          },
226           {
227         "serviceName": "so",
228         "version": "v1",
229         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs",
230         "protocol": "REST",
231         "port": "{{ .Values.service.internalPort }}",
232         "visualRange":"0",
233         "lb_policy":"ip_hash"
234          },
235           {
236         "serviceName": "so",
237         "version": "v1",
238         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace",
239         "protocol": "REST",
240         "port": "{{ .Values.service.internalPort }}",
241         "visualRange":"0",
242         "lb_policy":"ip_hash"
243          },
244          {
245         "serviceName": "so",
246         "version": "v1",
247         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}",
248         "protocol": "REST",
249         "port": "{{ .Values.service.internalPort }}",
250         "visualRange":"0",
251         "lb_policy":"ip_hash"
252          },
253          {
254         "serviceName": "so",
255         "version": "v1",
256         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig",
257         "protocol": "REST",
258         "port": "{{ .Values.service.internalPort }}",
259         "visualRange":"0",
260         "lb_policy":"ip_hash"
261          },
262           {
263         "serviceName": "so",
264         "version": "v1",
265         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}",
266         "protocol": "REST",
267         "port": "{{ .Values.service.internalPort }}",
268         "visualRange":"0",
269         "lb_policy":"ip_hash"
270          },
271          {
272         "serviceName": "so",
273         "version": "v1",
274         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules",
275         "protocol": "REST",
276         "port": "{{ .Values.service.internalPort }}",
277         "visualRange":"0",
278         "lb_policy":"ip_hash"
279          },
280          {
281         "serviceName": "so",
282         "version": "v1",
283         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace",
284         "protocol": "REST",
285         "port": "{{ .Values.service.internalPort }}",
286         "visualRange":"0",
287         "lb_policy":"ip_hash"
288          },
289           {
290         "serviceName": "so",
291         "version": "v1",
292         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}",
293         "protocol": "REST",
294         "port": "{{ .Values.service.internalPort }}",
295         "visualRange":"0",
296         "lb_policy":"ip_hash"
297          },
298           {
299         "serviceName": "so",
300         "version": "v1",
301         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][6-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate",
302         "protocol": "REST",
303         "port": "{{ .Values.service.internalPort }}",
304         "visualRange":"0",
305         "lb_policy":"ip_hash"
306          },
307           {
308         "serviceName": "so",
309         "version": "v1",
310         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}",
311         "protocol": "REST",
312         "port": "{{ .Values.service.internalPort }}",
313         "visualRange":"0",
314         "lb_policy":"ip_hash"
315          },
316          {
317         "serviceName": "so",
318         "version": "v1",
319         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete",
320         "protocol": "REST",
321         "port": "{{ .Values.service.internalPort }}",
322         "visualRange":"0",
323         "lb_policy":"ip_hash"
324          },
325          {
326         "serviceName": "so",
327         "version": "v1",
328         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut",
329         "protocol": "REST",
330         "port": "{{ .Values.service.internalPort }}",
331         "visualRange":"0",
332         "lb_policy":"ip_hash"
333          },
334           {
335         "serviceName": "so",
336         "version": "v1",
337         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups",
338         "protocol": "REST",
339         "port": "{{ .Values.service.internalPort }}",
340         "visualRange":"0",
341         "lb_policy":"ip_hash"
342          },
343          {
344         "serviceName": "so",
345         "version": "v1",
346         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}",
347         "protocol": "REST",
348         "port": "{{ .Values.service.internalPort }}",
349         "visualRange":"0",
350         "lb_policy":"ip_hash"
351          },
352          {
353         "serviceName": "so",
354         "version": "v1",
355         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}",
356         "protocol": "REST",
357         "port": "{{ .Values.service.internalPort }}",
358         "visualRange":"0",
359         "lb_policy":"ip_hash"
360          },
361           {
362         "serviceName": "so",
363         "version": "v1",
364         "url": "/onap/so/infra/serviceInstantiation/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks",
365         "protocol": "REST",
366         "port": "{{ .Values.service.internalPort }}",
367         "visualRange":"0",
368         "lb_policy":"ip_hash"
369          },
370           {
371         "serviceName": "so",
372         "version": "v1",
373         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}",
374         "protocol": "REST",
375         "port": "{{ .Values.service.internalPort }}",
376         "visualRange":"0",
377         "lb_policy":"ip_hash"
378          },
379           {
380         "serviceName": "so",
381         "version": "v1",
382         "url": "/onap/so/infra/serviceInstantiationRequests/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}",
383         "protocol": "REST",
384         "port": "{{ .Values.service.internalPort }}",
385         "visualRange":"0",
386         "lb_policy":"ip_hash"
387          }
388          ]'
389 spec:
390   type: {{ .Values.service.type }}
391   ports:
392     {{if eq .Values.service.type "NodePort" -}}
393     - port: {{ .Values.service.internalPort }}
394       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
395       name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
396     {{- else -}}
397     - port: {{ .Values.service.externalPort }}
398       targetPort: {{ .Values.service.internalPort }}
399       name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
400     {{- end}}
401   selector:
402     app: {{ include "common.name" . }}
403     release: {{ include "common.release" . }}