apiVersion: v1
kind: Service
metadata:
  name: {{ template "neo4j.fullname" . }}
  labels:
    app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
    app.kubernetes.io/instance: {{ .Release.Name | quote }}
    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    app.kubernetes.io/name: {{ template "neo4j.name" . }}
    app.kubernetes.io/component: core
spec:
  clusterIP: None
  # This next line is critical:  cluster members cannot discover each other without published
  # addresses, but without this, they can't get addresses unless they're ready (Catch-22)
  publishNotReadyAddresses: true 
  ports:
    - name: http
      port: 7474
      targetPort: 7474
    - name: bolt
      port: 7687
      targetPort: 7687
    - name: https
      port: 7473
      targetPort: 7473
  selector:
    app.kubernetes.io/name: {{ template "neo4j.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name | quote }}
    app.kubernetes.io/component: core
