# helm_charts_mongodb-service.yaml
# 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" . }}
  namespace: {{ template "mongodb-replicaset.namespace" . }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: mongodb
      port: {{ .Values.port }}
  publishNotReadyAddresses: true
  selector:
    app: {{ template "mongodb-replicaset.name" . }}
    release: {{ .Release.Name }}