{{- define "common.service.tpl" -}}
apiVersion: v1
kind: Service
{{ template "common.metadata" . }}
spec:
  type: {{ .Values.service.type }}
  ports:
  - name: http
    port: 80
    targetPort: http
  selector:
    app.kubernetes.io/name: {{ template "common.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- end -}}
{{- define "common.service" -}}
{{- template "common.util.merge" (append . "common.service.tpl") -}}
{{- end -}}
