apiVersion: v1
kind: Service
metadata:
  name: "{{ template "goldfish.fullname" . }}"
  labels:
    app: "{{ template "goldfish.name" . }}"
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.externalPort }}
      targetPort: {{ .Values.service.internalPort }}
      {{- if .Values.service.nodePort }}
      nodePort: {{ .Values.service.nodePort}}
      {{- end }}
      protocol: TCP
      name: {{ .Values.service.name }}
  selector:
    app: {{ template "goldfish.name" . }}
    release: {{ .Release.Name }}
