# Headless PEER-discovery Service (m11p5 ยง4). # # Gives every StatefulSet pod a stable per-pod DNS name # tidaldb-N.tidaldb-peers.tidaldb-cluster.svc.cluster.local # which is exactly what the topology ConfigMap advertises as each region's # grpc_addr/http_addr. Peers dial these names; tonic re-resolves DNS on every # reconnect so a pod rescheduled onto a new IP becomes reachable with no peer # restart (the whole point of the m11p5 bind/advertise split). # # publishNotReadyAddresses: true is LOAD-BEARING. The m11p5 readiness predicate # 503s a joiner/quarantined/reseeding pod (so the CLIENT Service drops it from # load-balancing โ€” see service-client.yaml). But peer discovery, snapshot fetch, # and the catch-up stream must still RESOLVE a not-ready joiner's DNS, or the # joiner can never reach a seed to converge and become ready โ€” a deadlock. This # Service keeps NOT-ready pods in its DNS A-records for exactly that reason. # # This Service is also `serviceName` for the StatefulSet (stable network ids). apiVersion: v1 kind: Service metadata: name: tidaldb-peers namespace: tidaldb-cluster labels: app.kubernetes.io/name: tidaldb app.kubernetes.io/part-of: tidaldb spec: clusterIP: None # headless: per-pod DNS, no VIP publishNotReadyAddresses: true # keep not-ready joiners resolvable for peers selector: app.kubernetes.io/name: tidaldb app.kubernetes.io/component: cluster-node ports: - name: http port: 9500 targetPort: http # One gRPC port per hosted shard group (m11p6/m12p4 3-group topology). A # headless Service routes by pod DNS โ†’ pod IP, so peers dial the derived # per-group ports (9601/9602/9603) on the pod directly regardless of this # list; the entries are declared so the named ports stay discoverable and # match statefulset.yaml. With the legacy single group only `grpc` (9601) # is bound. - name: grpc port: 9601 targetPort: grpc - name: grpc-1 port: 9602 targetPort: grpc-1 - name: grpc-2 port: 9603 targetPort: grpc-2 - name: metrics port: 9091 targetPort: metrics