apiVersion: v1
kind: Service
metadata:
  name: {{ include "common.names.fullname" . }}-headless
  labels: {{- include "common.labels.standard" . | nindent 4 }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: mongodb
      port: {{ .Values.service.port }}
    {{- if .Values.service.extraPorts }}
      {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
    {{- end }}
  selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
