blob: a1648c2e303e43c36e8fe4868c613dcf678a9ea1 [file] [log] [blame]
jmac065e2ce2018-03-29 01:18:02 +00001# Copyright © 2017 Amdocs, Bell Canada
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
15apiVersion: v1
16kind: Service
17metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000018 name: {{ include "common.servicename" . }}
jmac065e2ce2018-03-29 01:18:02 +000019 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": "sdnc",
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 }}
BorislavG1ffbd992018-04-24 07:56:27 +000044 name: "{{ .Values.service.portName }}-8282"
jmac065e2ce2018-03-29 01:18:02 +000045 - port: {{ .Values.service.externalPort2 }}
46 targetPort: {{ .Values.service.internalPort2 }}
47 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
BorislavG1ffbd992018-04-24 07:56:27 +000048 name: "{{ .Values.service.portName }}-8202"
jmac065e2ce2018-03-29 01:18:02 +000049 - port: {{ .Values.service.externalPort3 }}
50 targetPort: {{ .Values.service.internalPort3 }}
51 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
BorislavG1ffbd992018-04-24 07:56:27 +000052 name: "{{ .Values.service.portName }}-8280"
jmaca68f4cb2018-05-10 22:44:19 +000053 - port: {{ .Values.service.externalPort4 }}
54 targetPort: {{ .Values.service.internalPort4 }}
55 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }}
56 name: "{{ .Values.service.portName }}-8443"
jmac065e2ce2018-03-29 01:18:02 +000057 {{- else -}}
58 - port: {{ .Values.service.externalPort }}
59 targetPort: {{ .Values.service.internalPort }}
BorislavG1ffbd992018-04-24 07:56:27 +000060 name: {{ .Values.service.portName }}
jmac065e2ce2018-03-29 01:18:02 +000061 {{- end}}
62 selector:
63 app: {{ include "common.name" . }}
64 release: {{ .Release.Name }}
65---
66apiVersion: v1
67kind: Service
68metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000069 name: {{ .Values.service.portName }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000070 namespace: {{ include "common.namespace" . }}
71 labels:
72 app: {{ include "common.name" . }}
73 release: {{ .Release.Name }}
74 annotations:
75 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
76spec:
77 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000078 - name: "{{ .Values.service.portName }}-cluster-port"
jmac065e2ce2018-03-29 01:18:02 +000079 port: {{ .Values.service.clusterPort }}
80 clusterIP: None
81 selector:
82 app: {{ include "common.name" . }}
83 release: {{ .Release.Name }}
84 sessionAffinity: None
85 type: ClusterIP
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040086
87{{ if .Values.geoEnabled }}
88---
89apiVersion: v1
90kind: Service
91metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000092 name: sdnhost-{{ include "common.servicename" . }}-0
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040093 namespace: {{ .Release.Namespace }}
94 labels:
95 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
96spec:
97 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000098 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040099 port: {{ .Values.service.clusterPort2 }}
100 targetPort: {{ .Values.service.internalPort4 }}
101 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort4 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000102 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400103 port: {{ .Values.service.clusterPort3 }}
104 targetPort: {{ .Values.service.internalPort }}
105 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort1 }}
106 type: NodePort
107 selector:
108 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
109{{ end }}
110{{ if .Values.geoEnabled }}
111---
112apiVersion: v1
113kind: Service
114metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000115 name: sdnhost-{{ include "common.servicename" . }}-1
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400116 namespace: {{ .Release.Namespace }}
117 labels:
118 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
119spec:
120 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000121 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400122 port: {{ .Values.service.clusterPort2 }}
123 targetPort: {{ .Values.service.internalPort4 }}
124 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort5 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000125 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400126 port: {{ .Values.service.clusterPort3 }}
127 targetPort: {{ .Values.service.internalPort }}
128 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort2 }}
129 type: NodePort
130 selector:
131 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
132{{ end }}
133{{ if .Values.geoEnabled }}
134---
135apiVersion: v1
136kind: Service
137metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000138 name: sdnhost-{{ include "common.servicename" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400139 namespace: {{ .Release.Namespace }}
140 labels:
141 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
142spec:
143 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000144 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400145 port: {{ .Values.service.clusterPort2 }}
146 targetPort: {{ .Values.service.internalPort4 }}
147 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort6 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000148 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400149 port: {{ .Values.service.clusterPort3 }}
150 targetPort: {{ .Values.service.internalPort }}
151 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort3 }}
152 type: NodePort
153 selector:
154 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400155{{ end }}