blob: eb95ffc405a8c7fa52c9c1dcac95deca152c408a [file] [log] [blame]
Jakub Latusek647e2cf2020-10-21 13:27:09 +02001{{/*
Mukul2b4e7532018-08-03 10:41:29 +00002# Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved.
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.
Jakub Latusek647e2cf2020-10-21 13:27:09 +020015*/}}
Mukul2b4e7532018-08-03 10:41:29 +000016
Mike Elliott13fed112018-02-28 08:33:33 -050017apiVersion: v1
18kind: Service
19metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000020 name: {{ include "common.servicename" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050021 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050026 heritage: {{ .Release.Service }}
27 annotations:
28 msb.onap.org/service-info: '[
29 {
30 "serviceName": "appc",
31 "version": "v1",
32 "url": "/",
33 "protocol": "REST",
34 "port": "{{ .Values.service.externalPort }}",
35 "visualRange":"1",
36 "path": "/"
37 }
38 ]'
39spec:
40 type: {{ .Values.service.type }}
41 ports:
42 {{if eq .Values.service.type "NodePort" -}}
43 - port: {{ .Values.service.externalPort }}
44 targetPort: {{ .Values.service.internalPort }}
45 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
Taka Cho96a53f72020-03-13 15:42:34 -040046 name: "{{ .Values.service.portName }}-8443"
Mike Elliott13fed112018-02-28 08:33:33 -050047 - port: {{ .Values.service.externalPort2 }}
Taka Cho3c29d5f2019-09-04 15:38:31 -040048 targetPort: {{ .Values.service.internalPort2 }}
Mike Elliott13fed112018-02-28 08:33:33 -050049 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
Taka Cho96a53f72020-03-13 15:42:34 -040050 name: "{{ .Values.service.portName }}-1830"
Patrick Brady140deb92018-05-23 08:56:24 -070051 - port: {{ .Values.service.externalPort3 }}
Patrick Brady1a62b662018-05-30 10:56:46 -070052 targetPort: {{ .Values.service.internalPort3 }}
Patrick Brady140deb92018-05-23 08:56:24 -070053 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
54 name: "{{ .Values.service.portName }}-9090"
Mike Elliott13fed112018-02-28 08:33:33 -050055 {{- else -}}
56 - port: {{ .Values.service.externalPort }}
57 targetPort: {{ .Values.service.internalPort }}
Taka Cho96a53f72020-03-13 15:42:34 -040058 name: {{ .Values.service.portName }}-8443
BorislavG1ffbd992018-04-24 07:56:27 +000059 - port: {{ .Values.service.externalPort2 }}
60 targetPort: {{ .Values.service.internalPort2 }}
Taka Cho96a53f72020-03-13 15:42:34 -040061 name: {{ .Values.service.portName }}-1830
Patrick Brady140deb92018-05-23 08:56:24 -070062 - port: {{ .Values.service.externalPort3 }}
63 targetPort: {{ .Values.service.internalPort3 }}
64 name: {{ .Values.service.portName }}-9090
Mike Elliott13fed112018-02-28 08:33:33 -050065 {{- end}}
66 selector:
67 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010068 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050069---
70apiVersion: v1
71kind: Service
72metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000073 name: {{ include "common.servicename" . }}-cluster
Mike Elliott13fed112018-02-28 08:33:33 -050074 namespace: {{ include "common.namespace" . }}
75 labels:
76 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010077 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050078 annotations:
79 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
80spec:
81 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000082 - name: "{{ .Values.service.portName }}-cluster-port"
Mike Elliott13fed112018-02-28 08:33:33 -050083 port: {{ .Values.service.clusterPort }}
84 clusterIP: None
85 selector:
86 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010087 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050088 sessionAffinity: None
89 type: ClusterIP