apiVersion: v1
kind: Service
metadata:
  name: {{ include "rabbitmq.fullname" . }}-headless
  namespace: {{ .Release.Namespace }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
spec:
  clusterIP: None
  ports:
    - name: epmd
      port: 4369
      targetPort: epmd
    - name: amqp
      port: {{ .Values.service.port }}
      targetPort: amqp
    {{- if .Values.auth.tls.enabled }}
    - name: amqp-tls
      port: {{ .Values.service.tlsPort }}
      targetPort: amqp-tls
    {{- end }}
    - name: dist
      port: {{ .Values.service.distPort }}
      targetPort: dist
    - name: stats
      port: {{ .Values.service.managerPort }}
      targetPort: stats
  selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
