blob: e3f756976715e5e9c7d6dd3f1da63a134f0997ba [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002#
3# ============LICENSE_START=======================================================
4# org.onap.aai
5# ================================================================================
6# Copyright © 2018 AT&T Intellectual Property. All rights reserved.
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +01007# Modifications Copyright © 2021 Orange
Sylvain Desbureaux70070412020-11-09 21:58:48 +01008# ================================================================================
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20# ============LICENSE_END=========================================================
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010021*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010022
23apiVersion: v1
24kind: Service
25metadata:
26 name: {{ include "common.servicename" . }}
27 namespace: {{ include "common.namespace" . }}
28 labels:
29 app: {{ include "common.name" . }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020030 app.kubernetes.io/name: {{ include "common.name" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010031 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
32 release: {{ include "common.release" . }}
33 heritage: {{ .Release.Service }}
34spec:
35 type: {{ .Values.service.type }}
36 ports:
37 {{if eq .Values.service.type "NodePort" -}}
38 - port: {{ .Values.service.internalPort }}
39 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
Andreas Geissler5846a6e2023-03-30 17:26:14 +020040 name: {{ .Values.service.portName }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020041 targetPort: {{ .Values.service.portName }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010042 - port: {{ .Values.service.internalPort2 }}
43 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
44 name: {{ .Values.service.portName2 }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020045 targetPort: {{ .Values.service.portName2 }}
leila46fb5802022-11-15 11:33:21 -050046 - port: {{ .Values.service.internalPort3 }}
47 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
48 name: {{ .Values.service.portName3 }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020049 targetPort: {{ .Values.service.portName3 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010050 {{- else -}}
51 - port: {{ .Values.service.internalPort }}
Andreas Geissler5846a6e2023-03-30 17:26:14 +020052 name: {{ .Values.service.portName }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020053 targetPort: {{ .Values.service.portName }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010054 - port: {{ .Values.service.internalPort2 }}
55 name: {{ .Values.service.portName2 }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020056 targetPort: {{ .Values.service.portName2 }}
leila46fb5802022-11-15 11:33:21 -050057 - port: {{ .Values.service.internalPort3 }}
58 name: {{ .Values.service.portName3 }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020059 targetPort: {{ .Values.service.portName }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010060 {{- end}}
61 selector:
62 app: {{ include "common.name" . }}
63 release: {{ include "common.release" . }}