blob: 586144b6e908b0dd0a4b22c351dc03e036feaf84 [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"
jmac065e2ce2018-03-29 01:18:02 +000053 {{- else -}}
54 - port: {{ .Values.service.externalPort }}
55 targetPort: {{ .Values.service.internalPort }}
BorislavG1ffbd992018-04-24 07:56:27 +000056 name: {{ .Values.service.portName }}
jmac065e2ce2018-03-29 01:18:02 +000057 {{- end}}
58 selector:
59 app: {{ include "common.name" . }}
60 release: {{ .Release.Name }}
61---
62apiVersion: v1
63kind: Service
64metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000065 name: {{ .Values.service.portName }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000066 namespace: {{ include "common.namespace" . }}
67 labels:
68 app: {{ include "common.name" . }}
69 release: {{ .Release.Name }}
70 annotations:
71 service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
72spec:
73 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000074 - name: "{{ .Values.service.portName }}-cluster-port"
jmac065e2ce2018-03-29 01:18:02 +000075 port: {{ .Values.service.clusterPort }}
76 clusterIP: None
77 selector:
78 app: {{ include "common.name" . }}
79 release: {{ .Release.Name }}
80 sessionAffinity: None
81 type: ClusterIP
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040082
83{{ if .Values.geoEnabled }}
84---
85apiVersion: v1
86kind: Service
87metadata:
BorislavG1ffbd992018-04-24 07:56:27 +000088 name: sdnhost-{{ include "common.servicename" . }}-0
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040089 namespace: {{ .Release.Namespace }}
90 labels:
91 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
92spec:
93 ports:
BorislavG1ffbd992018-04-24 07:56:27 +000094 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040095 port: {{ .Values.service.clusterPort2 }}
96 targetPort: {{ .Values.service.internalPort4 }}
97 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort4 }}
BorislavG1ffbd992018-04-24 07:56:27 +000098 - name: {{ .Values.service.portName }}-0-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -040099 port: {{ .Values.service.clusterPort3 }}
100 targetPort: {{ .Values.service.internalPort }}
101 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort1 }}
102 type: NodePort
103 selector:
104 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0
105{{ end }}
106{{ if .Values.geoEnabled }}
107---
108apiVersion: v1
109kind: Service
110metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000111 name: sdnhost-{{ include "common.servicename" . }}-1
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400112 namespace: {{ .Release.Namespace }}
113 labels:
114 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
115spec:
116 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000117 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400118 port: {{ .Values.service.clusterPort2 }}
119 targetPort: {{ .Values.service.internalPort4 }}
120 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort5 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000121 - name: {{ .Values.service.portName }}-1-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400122 port: {{ .Values.service.clusterPort3 }}
123 targetPort: {{ .Values.service.internalPort }}
124 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort2 }}
125 type: NodePort
126 selector:
127 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1
128{{ end }}
129{{ if .Values.geoEnabled }}
130---
131apiVersion: v1
132kind: Service
133metadata:
BorislavG1ffbd992018-04-24 07:56:27 +0000134 name: sdnhost-{{ include "common.servicename" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400135 namespace: {{ .Release.Namespace }}
136 labels:
137 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
138spec:
139 ports:
BorislavG1ffbd992018-04-24 07:56:27 +0000140 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort4 }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400141 port: {{ .Values.service.clusterPort2 }}
142 targetPort: {{ .Values.service.internalPort4 }}
143 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort6 }}
BorislavG1ffbd992018-04-24 07:56:27 +0000144 - name: {{ .Values.service.portName }}-2-port-{{ .Values.service.internalPort }}
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400145 port: {{ .Values.service.clusterPort3 }}
146 targetPort: {{ .Values.service.internalPort }}
147 nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort3 }}
148 type: NodePort
149 selector:
150 statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2
Mohammadreza Pasandidehb756fb72018-04-03 10:06:45 -0400151{{ end }}