tidaldb/k8s/cluster/service-client.yaml

35 lines
1.4 KiB
YAML

# Client-facing Service (m11p5 §4) — readiness-gated load balancing.
#
# This is the address in-cluster clients hit for HTTP reads/writes. It is a
# normal (VIP) Service, so the default readiness gating applies: a pod that the
# m11p5 readiness predicate marks 503 (a joiner before first-convergence, a
# quarantined node, a removed/reseeding node, a draining node on SIGTERM) is
# REMOVED from this Service's endpoints and receives no client traffic. Only
# converged, serving voters answer clients here.
#
# Contrast with tidaldb-peers (headless, publishNotReadyAddresses: true): peers
# must still resolve a not-ready joiner to feed it a snapshot + stream, so that
# Service keeps not-ready pods. This Service must NOT — a client must never be
# routed to a node still catching up.
#
# Forwarding works regardless of which pod a client lands on: any region forwards
# writes to the current leader and reads serve locally. Front this with an
# Ingress/Gateway for external traffic; never expose :9091 metrics externally
# (unauthenticated).
apiVersion: v1
kind: Service
metadata:
name: tidaldb
namespace: tidaldb-cluster
labels:
app.kubernetes.io/name: tidaldb
app.kubernetes.io/part-of: tidaldb
spec:
selector:
app.kubernetes.io/name: tidaldb
app.kubernetes.io/component: cluster-node
ports:
- name: http
port: 9500
targetPort: http