blob: a44214a611cf1263b4b3503e0e2a8a0491d89d8e [file] [log] [blame]
Mukul2b4e7532018-08-03 10:41:29 +00001# Copyright © 2018 AT&T, Amdocs, Bell Canada 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
Mike Elliott13fed112018-02-28 08:33:33 -050015apiVersion: v1
16kind: Service
17metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000018 name: {{ include "common.servicename" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050019 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25 annotations:
26 msb.onap.org/service-info: '[
27 {
28 "serviceName": "appc",
29 "version": "v1",
30 "url": "/",
31 "protocol": "REST",
32 "port": "{{ .Values.service.externalPort }}",
33 "visualRange":"1",
34 "path": "/"
35 }
36 ]'
37spec:
38 type: {{ .Values.service.type }}
39 ports:
40 {{if eq .Values.service.type "NodePort" -}}
41 - port: {{ .Values.service.externalPort }}
42 targetPort: {{ .Values.service.internalPort }}
43 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040044 name: "{{ .Values.service.portName }}-8282"
Mike Elliott13fed112018-02-28 08:33:33 -050045 - port: {{ .Values.service.externalPort2 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040046 targetPort: {{ .Values.service.internalPort2 }}
Mike Elliott13fed112018-02-28 08:33:33 -050047 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040048 name: "{{ .Values.service.portName }}-8443"
Patrick Brady140deb92018-05-23 08:56:24 -070049 - port: {{ .Values.service.externalPort3 }}
Patrick Brady1a62b662018-05-30 10:56:46 -070050 targetPort: {{ .Values.service.internalPort3 }}
Patrick Brady140deb92018-05-23 08:56:24 -070051 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040052 name: "{{ .Values.service.portName }}-1830"
53 - port: {{ .Values.service.externalPort4 }}
54 targetPort: {{ .Values.service.internalPort4 }}
55 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }}
Patrick Brady140deb92018-05-23 08:56:24 -070056 name: "{{ .Values.service.portName }}-9090"
Mike Elliott13fed112018-02-28 08:33:33 -050057 {{- else -}}
58 - port: {{ .Values.service.externalPort }}
59 targetPort: {{ .Values.service.internalPort }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040060 name: {{ .Values.service.portName }}-8282
BorislavG1ffbd992018-04-24 07:56:27 +000061 - port: {{ .Values.service.externalPort2 }}
62 targetPort: {{ .Values.service.internalPort2 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040063 name: {{ .Values.service.portName }}-8443
Patrick Brady140deb92018-05-23 08:56:24 -070064 - port: {{ .Values.service.externalPort3 }}
65 targetPort: {{ .Values.service.internalPort3 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040066 name: {{ .Values.service.portName }}-1830
67 - port: {{ .Values.service.externalPort4 }}
68 targetPort: {{ .Values.service.internalPort4 }}
Patrick Brady140deb92018-05-23 08:56:24 -070069 name: {{ .Values.service.portName }}-9090
Mike Elliott13fed112018-02-28 08:33:33 -050070 {{- end}}
71 selector:
72 app: {{ include "common.name" . }}
73 release: {{ .Release.Name }}
74---
75apiVersion: v1
76kind: Service
77metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000078 name: {{ include "common.servicename" . }}-cluster
Mike Elliott13fed112018-02-28 08:33:33 -050079 namespace: {{ include "common.namespace" . }}
80 labels:
81 app: {{ include "common.name" . }}
82 release: {{ .Release.Name }}
83 annotations:
84 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
85spec:
86 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000087 - name: "{{ .Values.service.portName }}-cluster-port"
Mike Elliott13fed112018-02-28 08:33:33 -050088 port: {{ .Values.service.clusterPort }}
89 clusterIP: None
90 selector:
91 app: {{ include "common.name" . }}
92 release: {{ .Release.Name }}
93 sessionAffinity: None
94 type: ClusterIP