jmac | 065e2ce | 2018-03-29 01:18:02 +0000 | [diff] [blame] | 1 | # 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 | |
| 15 | apiVersion: v1 |
| 16 | kind: Service |
| 17 | metadata: |
| 18 | name: {{ include "common.fullname" . }} |
| 19 | 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 | ]' |
| 37 | spec: |
| 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 }} |
| 44 | name: "{{ .Values.service.name }}-8282" |
| 45 | - port: {{ .Values.service.externalPort2 }} |
| 46 | targetPort: {{ .Values.service.internalPort2 }} |
| 47 | nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} |
| 48 | name: "{{ .Values.service.name }}-8202" |
| 49 | - port: {{ .Values.service.externalPort3 }} |
| 50 | targetPort: {{ .Values.service.internalPort3 }} |
| 51 | nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }} |
| 52 | name: "{{ .Values.service.name }}-8280" |
| 53 | {{- else -}} |
| 54 | - port: {{ .Values.service.externalPort }} |
| 55 | targetPort: {{ .Values.service.internalPort }} |
| 56 | name: {{ .Values.service.name }} |
| 57 | {{- end}} |
| 58 | selector: |
| 59 | app: {{ include "common.name" . }} |
| 60 | release: {{ .Release.Name }} |
| 61 | --- |
| 62 | apiVersion: v1 |
| 63 | kind: Service |
| 64 | metadata: |
| 65 | name: {{ .Values.service.name }}-cluster |
| 66 | 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" |
| 72 | spec: |
| 73 | ports: |
| 74 | - name: "{{ .Values.service.name }}-cluster-port" |
| 75 | 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 Pasandideh | b756fb7 | 2018-04-03 10:06:45 -0400 | [diff] [blame] | 82 | |
| 83 | {{ if .Values.geoEnabled }} |
| 84 | --- |
| 85 | apiVersion: v1 |
| 86 | kind: Service |
| 87 | metadata: |
| 88 | name: sdnhost-{{ include "common.fullname" . }}-0 |
| 89 | namespace: {{ .Release.Namespace }} |
| 90 | labels: |
| 91 | statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0 |
| 92 | spec: |
| 93 | ports: |
| 94 | - name: {{ include "common.fullname" . }}-0-port-{{ .Values.service.internalPort4 }} |
| 95 | port: {{ .Values.service.clusterPort2 }} |
| 96 | targetPort: {{ .Values.service.internalPort4 }} |
| 97 | nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort4 }} |
| 98 | - name: {{ include "common.fullname" . }}-0-port-{{ .Values.service.internalPort }} |
| 99 | 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 | --- |
| 108 | apiVersion: v1 |
| 109 | kind: Service |
| 110 | metadata: |
| 111 | name: sdnhost-{{ include "common.fullname" . }}-1 |
| 112 | namespace: {{ .Release.Namespace }} |
| 113 | labels: |
| 114 | statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-1 |
| 115 | spec: |
| 116 | ports: |
| 117 | - name: {{ include "common.fullname" . }}-1-port-{{ .Values.service.internalPort4 }} |
| 118 | port: {{ .Values.service.clusterPort2 }} |
| 119 | targetPort: {{ .Values.service.internalPort4 }} |
| 120 | nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort5 }} |
| 121 | - name: {{ include "common.fullname" . }}-1-port-{{ .Values.service.internalPort }} |
| 122 | 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 | --- |
| 131 | apiVersion: v1 |
| 132 | kind: Service |
| 133 | metadata: |
| 134 | name: sdnhost-{{ include "common.fullname" . }}-2 |
| 135 | namespace: {{ .Release.Namespace }} |
| 136 | labels: |
| 137 | statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-2 |
| 138 | spec: |
| 139 | ports: |
| 140 | - name: {{ include "common.fullname" . }}-2-port-{{ .Values.service.internalPort4 }} |
| 141 | port: {{ .Values.service.clusterPort2 }} |
| 142 | targetPort: {{ .Values.service.internalPort4 }} |
| 143 | nodePort: {{ .Values.nodePortPrefix }}{{ .Values.service.geoNodePort6 }} |
| 144 | - name: {{ include "common.fullname" . }}-2-port-{{ .Values.service.internalPort }} |
| 145 | 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 |
| 151 | --- |
| 152 | {{ end }} |
| 153 | |