# Headless Service: gives the StatefulSet pod a stable DNS name
# (tidaldb-0.tidaldb.tidaldb.svc.cluster.local) and backs in-cluster clients.
# Headless (clusterIP: None) is the right default for a single stateful pod;
# readiness gating still applies, so the pod drops out of DNS A-records while
# draining. Front it with an Ingress/Gateway for external traffic — do NOT
# expose the metrics port (9091) outside the cluster (it is unauthenticated).
apiVersion: v1
kind: Service
metadata:
  name: tidaldb
  namespace: tidaldb
  labels:
    app.kubernetes.io/name: tidaldb
spec:
  clusterIP: None
  selector:
    app.kubernetes.io/name: tidaldb
  ports:
    - name: http
      port: 9400
      targetPort: http
    - name: metrics
      port: 9091
      targetPort: metrics
