# A headless service to create DNS records for discovery purposes. Use the -client service to connect applications
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
  labels:
    app: {{ template "mongodb-replicaset.name" . }}
    chart: {{ template "mongodb-replicaset.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
{{- if .Values.extraLabels }}
{{ toYaml .Values.extraLabels | indent 4 }}
{{- end }}
  name: {{ template "mongodb-replicaset.fullname" . }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: mongodb
      port: {{ .Values.port }}
  publishNotReadyAddresses: true
  selector:
    app: {{ template "mongodb-replicaset.name" . }}
    release: {{ .Release.Name }}
