apiVersion: v1
kind: Service
metadata:
  name: {{ template "parse.fullname" . }}
  labels:
    app: {{ template "parse.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  type: {{ .Values.serviceType }}
  {{- if eq .Values.serviceType "LoadBalancer" }}
  loadBalancerIP: {{ .Values.loadBalancerIP | quote }}
  {{- end }}
  ports:
  - name: server-http
    port: {{ .Values.server.port }}
    targetPort: server-http
  - name: dashboard-http
    port: 80
    targetPort: dashboard-http
  selector:
    app: {{ template "parse.name" . }}
    release: "{{ .Release.Name }}"
