blob: db6d73a3c5f2f6db409c4e95a1f33c66d5df1ced [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 }}
BorislavG1ffbd992018-04-24 07:56:27 +000043 name: "{{ .Values.service.portName }}-8282"
jmac065e2ce2018-03-29 01:18:02 +000044 - port: {{ .Values.service.externalPort2 }}
45 targetPort: {{ .Values.service.internalPort2 }}
BorislavG1ffbd992018-04-24 07:56:27 +000046 name: "{{ .Values.service.portName }}-8202"
jmac065e2ce2018-03-29 01:18:02 +000047 - port: {{ .Values.service.externalPort3 }}
48 targetPort: {{ .Values.service.internalPort3 }}
49 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
BorislavG1ffbd992018-04-24 07:56:27 +000050 name: "{{ .Values.service.portName }}-8280"
jmaca68f4cb2018-05-10 22:44:19 +000051 - port: {{ .Values.service.externalPort4 }}
52 targetPort: {{ .Values.service.internalPort4 }}
53 nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }}
54 name: "{{ .Values.service.portName }}-8443"
jmac065e2ce2018-03-29 01:18:02 +000055 {{- else -}}
56 - port: {{ .Values.service.externalPort }}
57 targetPort: {{ .Values.service.internalPort }}
BorislavG1ffbd992018-04-24 07:56:27 +000058 name: {{ .Values.service.portName }}
jmac065e2ce2018-03-29 01:18:02 +000059 {{- end}}
60 selector:
61 app: {{ include "common.name" . }}
62 release: {{ .Release.Name }}
63---
64apiVersion: v1
65kind: Service
66metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000067 name: {{ .Values.service.portName }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000068 namespace: {{ include "common.namespace" . }}
69 labels:
70 app: {{ include "common.name" . }}
71 release: {{ .Release.Name }}
72 annotations:
73 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
74spec:
75 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000076 - name: "{{ .Values.service.portName }}-cluster-port"
jmac065e2ce2018-03-29 01:18:02 +000077 port: {{ .Values.service.clusterPort }}
78 clusterIP: None
79 selector:
80 app: {{ include "common.name" . }}
81 release: {{ .Release.Name }}
82 sessionAffinity: None
83 type: ClusterIP
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040084
Trevor Tait567ff1e2018-05-01 16:20:54 -040085{{ if .Values.config.geoEnabled }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040086---
87apiVersion: v1
88kind: Service
89metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000090 name: sdnhost-{{ include "common.servicename" . }}-0
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040091 namespace: {{ .Release.Namespace }}
92 labels:
93 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
94spec:
95 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000096 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040097 port: {{ .Values.service.clusterPort2 }}
98 targetPort: {{ .Values.service.internalPort4 }}
jmac0e4f7172018-09-07 18:06:43 +000099 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort4 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000100 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400101 port: {{ .Values.service.clusterPort3 }}
102 targetPort: {{ .Values.service.internalPort }}
jmac0e4f7172018-09-07 18:06:43 +0000103 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort1 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400104 type: NodePort
105 selector:
106 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
107{{ end }}
Trevor Tait567ff1e2018-05-01 16:20:54 -0400108{{ if .Values.config.geoEnabled }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400109---
110apiVersion: v1
111kind: Service
112metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000113 name: sdnhost-{{ include "common.servicename" . }}-1
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400114 namespace: {{ .Release.Namespace }}
115 labels:
116 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
117spec:
118 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000119 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400120 port: {{ .Values.service.clusterPort2 }}
121 targetPort: {{ .Values.service.internalPort4 }}
jmac0e4f7172018-09-07 18:06:43 +0000122 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort5 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000123 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400124 port: {{ .Values.service.clusterPort3 }}
125 targetPort: {{ .Values.service.internalPort }}
jmac0e4f7172018-09-07 18:06:43 +0000126 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort2 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400127 type: NodePort
128 selector:
129 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
130{{ end }}
Trevor Tait567ff1e2018-05-01 16:20:54 -0400131{{ if .Values.config.geoEnabled }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400132---
133apiVersion: v1
134kind: Service
135metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000136 name: sdnhost-{{ include "common.servicename" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400137 namespace: {{ .Release.Namespace }}
138 labels:
139 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
140spec:
141 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000142 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400143 port: {{ .Values.service.clusterPort2 }}
144 targetPort: {{ .Values.service.internalPort4 }}
jmac0e4f7172018-09-07 18:06:43 +0000145 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort6 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000146 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400147 port: {{ .Values.service.clusterPort3 }}
148 targetPort: {{ .Values.service.internalPort }}
jmac0e4f7172018-09-07 18:06:43 +0000149 nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.geoNodePort3 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400150 type: NodePort
151 selector:
152 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400153{{ end }}