blob: bd181e1e57415a7a389f87434b9a2bb659513229 [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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050024 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 Cho96a53f72020-03-13 15:42:34 -040044 name: "{{ .Values.service.portName }}-8443"
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 Cho96a53f72020-03-13 15:42:34 -040048 name: "{{ .Values.service.portName }}-1830"
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 }}
52 name: "{{ .Values.service.portName }}-9090"
Mike Elliott13fed112018-02-28 08:33:33 -050053 {{- else -}}
54 - port: {{ .Values.service.externalPort }}
55 targetPort: {{ .Values.service.internalPort }}
Taka Cho96a53f72020-03-13 15:42:34 -040056 name: {{ .Values.service.portName }}-8443
BorislavG1ffbd992018-04-24 07:56:27 +000057 - port: {{ .Values.service.externalPort2 }}
58 targetPort: {{ .Values.service.internalPort2 }}
Taka Cho96a53f72020-03-13 15:42:34 -040059 name: {{ .Values.service.portName }}-1830
Patrick Brady140deb92018-05-23 08:56:24 -070060 - port: {{ .Values.service.externalPort3 }}
61 targetPort: {{ .Values.service.internalPort3 }}
62 name: {{ .Values.service.portName }}-9090
Mike Elliott13fed112018-02-28 08:33:33 -050063 {{- end}}
64 selector:
65 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010066 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050067---
68apiVersion: v1
69kind: Service
70metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000071 name: {{ include "common.servicename" . }}-cluster
Mike Elliott13fed112018-02-28 08:33:33 -050072 namespace: {{ include "common.namespace" . }}
73 labels:
74 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010075 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050076 annotations:
77 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
78spec:
79 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000080 - name: "{{ .Values.service.portName }}-cluster-port"
Mike Elliott13fed112018-02-28 08:33:33 -050081 port: {{ .Values.service.clusterPort }}
82 clusterIP: None
83 selector:
84 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010085 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050086 sessionAffinity: None
87 type: ClusterIP