Mike Elliott | 282a387 | 2018-02-28 09:55:14 -0500 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: Service |
| 3 | metadata: |
| 4 | name: {{ include "common.fullname" . }} |
| 5 | namespace: {{ include "common.namespace" . }} |
| 6 | labels: |
| 7 | app: {{ include "common.name" . }} |
| 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 9 | release: {{ .Release.Name }} |
| 10 | heritage: {{ .Release.Service }} |
| 11 | annotations: |
| 12 | # Example MSB registration annotation |
| 13 | # msb.onap.org/service-info: '[ |
| 14 | # { |
| 15 | # "serviceName": "so", |
| 16 | # "version": "v1", |
| 17 | # "url": "/ecomp/mso/infra", |
| 18 | # "protocol": "REST" |
| 19 | # "port": "8080", |
| 20 | # "visualRange":"1" |
| 21 | # } |
| 22 | # ]' |
| 23 | spec: |
| 24 | type: {{ .Values.service.type }} |
| 25 | ports: |
| 26 | {{if eq .Values.service.type "NodePort" -}} |
| 27 | - port: {{ .Values.service.externalPort }} |
| 28 | #Example internal target port if required |
| 29 | #targetPort: {{ .Values.service.internalPort }} |
| 30 | nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} |
| 31 | name: {{ .Values.service.name }} |
| 32 | {{- else -}} |
| 33 | - port: {{ .Values.service.externalPort }} |
| 34 | targetPort: {{ .Values.service.internalPort }} |
| 35 | name: {{ .Values.service.name }} |
| 36 | {{- end}} |
| 37 | selector: |
| 38 | app: {{ include "common.name" . }} |
| 39 | release: {{ .Release.Name }} |