{{- if .Values.service }}
---
kind: Service
apiVersion: v1
metadata:
  name: "{{ template "logstash.fullname" . }}"
  labels:
    app: "{{ template "logstash.fullname" . }}"
    chart: "{{ .Chart.Name }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
spec:
  type: {{ .Values.service.type }}
  selector:
    app: "{{ template "logstash.fullname" . }}"
    chart: "{{ .Chart.Name }}"
    release: {{ .Release.Name | quote }}
  ports:
{{ toYaml .Values.service.ports | indent 4 }}
{{- end }}
