apiVersion: v1
kind: Service
metadata:
  name: {{ template "fluentd.fullname" . }}
  labels:
    app: {{ template "fluentd.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  type: {{ .Values.service.type }}
  ports:
  {{- range $port := .Values.service.ports }}
    - name: {{ $port.name }}
      port: {{ $port.containerPort }}
      targetPort: {{ $port.containerPort }}
      protocol: {{ $port.protocol }}
  {{- end }}
  selector:
    app: {{ template "fluentd.name" . }}
    release: {{ .Release.Name }}
