apiVersion: v1
kind: Service
metadata:
  name: {{ include "n8n.fullname" . }}
  labels:
    {{- include "n8n.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type | default "ClusterIP" }}
  ports:
    - port: {{ .Values.service.port | default 80 }}
      targetPort: http
      protocol: TCP
      name: http
    {{- if .Values.runners.enabled }}
    - port: {{ .Values.service.brokerPort | default 5679 }}
      targetPort: broker
      protocol: TCP
      name: broker
    {{- end }}
  selector:
    {{- include "n8n.selectorLabels" . | nindent 4 }}
