apiVersion: v1
kind: Service
metadata:
  name: {{ template "magento.fullname" . }}
  labels:
    app: {{ template "magento.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  type: {{ .Values.serviceType }}
  {{- if eq .Values.serviceType "LoadBalancer" }}
  loadBalancerIP: {{ default "" .Values.magentoLoadBalancerIP }}
  {{- end }}
  ports:
  - name: http
    port: 80
    targetPort: http
  - name: https
    port: 443
    targetPort: https
  selector:
    app: {{ template "magento.fullname" . }}
