9580e755903e21b30964f4320b74279d4b2e8ac4
[oom.git] / kubernetes / dmaap / templates / service.yaml
1 # Copyright © 2018  AT&T Intellectual Property.  All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 #{{ if not .Values.disableBuscontroller }}
16 apiVersion: v1
17 kind: Service
18 metadata:
19   name: {{ include "common.name" . }}-{{ .Values.buscontroller.service }}
20   namespace: {{ .Values.global.nsPrefix }}
21   labels:
22     app: {{ .Values.buscontroller.service }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service }}
26   annotations:
27 # Example MSB registration annotation
28 #    msb.onap.org/service-info: '[
29 #      {
30 #          "serviceName": "so",
31 #          "version": "v1",
32 #          "url": "/ecomp/mso/infra",
33 #          "protocol": "REST"
34 #          "port": "8080",
35 #          "visualRange":"1"
36 #      }
37 #      ]'
38 spec:
39   type: {{ .Values.buscontroller.type }}
40   ports:
41     {{if eq .Values.buscontroller.type "NodePort" -}}
42     - port: {{ .Values.buscontroller.httpExternalPort }}
43       targetPort: {{ .Values.buscontroller.httpExternalPort }}
44       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.buscontroller.httpPort }}
45       name: "{{ .Values.buscontroller.name }}-http-port"
46 #    This will be needed when we get SSL certificates
47 #    - port: {{ .Values.buscontroller.httpsExternalPort }}
48 #      targetPort: {{ .Values.buscontroller.httpsExternalPort }}
49 #      nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.buscontroller.httpsPort }}
50 #      name: "{{ .Values.buscontroller.name }}-https-port"
51     {{- else -}}
52     - port: {{ .Values.buscontroller.externalPort }}
53       targetPort: {{ .Values.buscontroller.httpPort }}
54       name: {{ .Values.buscontroller.name }}
55     {{- end}}
56   selector:
57     app: {{ include "common.name" . }}-{{ .Values.buscontroller.service }}
58     release: {{ .Release.Name }}
59
60 #{{ end }}