apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - name: http
      port: {{ .Values.service.port }}
      targetPort: {{ .Values.service.targetPort }}
      {{- if and (eq .Values.service.type "NodePort") .Values.service.enableNodePort }}
      nodePort: {{ .Values.service.nodePort }}
      {{- end }}
    - name: https
      port: {{ .Values.service.httpsPort }}
      targetPort: {{ .Values.service.targetPort }}
  selector:
    app: {{ .Release.Name }} 