---
apiVersion: v1
kind: Service
metadata:
  name: {{ include "falcosidekick.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "falcosidekick.labels" . | nindent 4 }}
    app.kubernetes.io/component: core
  {{- with .Values.service.annotations }}
  annotations:
    prometheus.io/scrape: "true"
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
    {{- if not (eq .Values.config.tlsserver.notlspaths "") }}
    - port: {{ .Values.config.tlsserver.notlsport }}
      targetPort: http-notls
      protocol: TCP
      name: http-notls
    {{- end }}
  selector:
    {{- include "falcosidekick.selectorLabels" . | nindent 4 }}
    app.kubernetes.io/component: core
