apiVersion: v1
kind: Service
metadata:
  labels:
    {{- include "aws-for-fluent-bit.labels" . | nindent 4 }}
  name: {{ include "aws-for-fluent-bit.fullname" . }}
  namespace: {{ include "aws-for-fluent-bit.namespace" . }}
spec:
  ports:
  - name: monitor-agent
    port: {{ .Values.serviceMonitor.service.port }}
    protocol: TCP
    targetPort: {{ .Values.serviceMonitor.service.targetPort }}
{{- if .Values.serviceMonitor.service.extraPorts }}
  {{- range .Values.serviceMonitor.service.extraPorts }}
  - name: {{ .name }}
    targetPort: {{ .targetPort }}
    protocol: {{ .protocol }}
    port: {{ .port }}
  {{- end }}
{{- end }}
  selector:
    {{- include "aws-for-fluent-bit.selectorLabels" . | nindent 4 }}
  sessionAffinity: None
  type: {{ .Values.serviceMonitor.service.type }}
