Complete M7.8 operations endpoints and region server image
ADR-0066: evo-server --ops-listen serves /livez (loop responding, never authority), /readyz (200 only while the host holds the lease with a verified recovered head) and /metrics (Prometheus text: 30 fixed series for readiness, phase, lease epoch/remaining, simulated/committed ticks, commit lag, checkpoint age, tick debt, queue use and bounds, and counters; the only labels are a 6-value phase and 4-value drop reason). The dependency-free OpsServer runs on the host loop with no thread: GET on exact paths, 405/404/400/431 responses, 8 connections with excess refused on accept, 4 KiB requests, 1 s deadlines, 16 KiB responses. HostStatus/phase types moved to the portable evo::ops library with a Windows-tested renderer. evo-server now refuses to start without its required identity and connection settings. Adds the server-runtime Docker target (evo-server + pinned libpq, UID 10001, no credentials), a CI server-image job with smoke script and optional publishing, and a Kubernetes example outside Argo. Validated: Windows CTest 59/59; Linux Debug/Release/clang-tidy/ASan CTest 59/59; PostgreSQL suites under Release, clang-tidy and ASan with real process probes; two ops mutations caught. Docker build/smoke and Gitea CI not executed locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
# M7.8 development region server (ADR-0066). NOT in the active Argo kustomization.
|
||||
# Before applying to evolution-dev: pin the server image digest, provision the region
|
||||
# (owner-only), create the runtime Secret and object PVC, and add DB/DNS egress for
|
||||
# the real endpoint. Never target World0 from this example.
|
||||
#
|
||||
# Authority, not liveness, gates traffic: /readyz is 200 only while this pod holds
|
||||
# the region lease and has recovered and verified the committed head. /livez only
|
||||
# says the loop is responding. A probe can wait up to one bounded I/O step (commit
|
||||
# deadline 5 s), so probe timeouts below exceed it.
|
||||
#
|
||||
# There is no gateway yet: stdin is not attached, so the region hosts authority but
|
||||
# receives no inputs (tick debt grows by design; nothing is invented).
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: evolution-region-7-1
|
||||
namespace: evolution-dev
|
||||
labels: {app.kubernetes.io/name: evolution-region, evolution.aeternalis/region: "7-1"}
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy: {type: Recreate} # Never two pods racing; the lease still arbitrates.
|
||||
selector:
|
||||
matchLabels: {app.kubernetes.io/name: evolution-region, evolution.aeternalis/region: "7-1"}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app.kubernetes.io/name: evolution-region, evolution.aeternalis/region: "7-1"}
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
terminationGracePeriodSeconds: 30 # SIGTERM drains within --drain-ms 20000.
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 10001
|
||||
runAsGroup: 10001
|
||||
fsGroup: 10001
|
||||
seccompProfile: {type: RuntimeDefault}
|
||||
initContainers:
|
||||
# libpq rejects group-readable password files: copy to a private 0600 file.
|
||||
- name: pgpass
|
||||
image: registry.aeternalisgames.com/aeternalis/aevolution-server:replace-with-immutable-digest
|
||||
command: ["/bin/sh", "-c", "install -m 0600 /run/postgres/pgpass /run/evo/pgpass"]
|
||||
securityContext: {readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, capabilities: {drop: [ALL]}}
|
||||
volumeMounts:
|
||||
- {name: connection, mountPath: /run/postgres, readOnly: true}
|
||||
- {name: private, mountPath: /run/evo}
|
||||
containers:
|
||||
- name: region
|
||||
image: registry.aeternalisgames.com/aeternalis/aevolution-server:replace-with-immutable-digest
|
||||
# Flags are "--name value" pairs; see docs/infrastructure/POSTGRESQL.md.
|
||||
command:
|
||||
- /usr/local/bin/evo-server
|
||||
- --profile
|
||||
- lineage
|
||||
- --world
|
||||
- "7"
|
||||
- --region
|
||||
- "1"
|
||||
- --frame
|
||||
- "9"
|
||||
- --pg-host
|
||||
- replace-with-tls-hostname
|
||||
- --pg-hostaddr
|
||||
- replace-with-numeric-address
|
||||
- --pg-port
|
||||
- "5432"
|
||||
- --pg-database
|
||||
- evolution
|
||||
- --pg-user
|
||||
- replace-with-runtime-login
|
||||
- --pg-passfile
|
||||
- /run/evo/pgpass
|
||||
- --pg-ca
|
||||
- /run/postgres/ca.crt
|
||||
- --objects
|
||||
- /var/lib/evolution/objects
|
||||
- --build
|
||||
- replace-with-retained-build-identity-hex
|
||||
- --ops-listen
|
||||
- 0.0.0.0:9100
|
||||
- --drain-ms
|
||||
- "20000"
|
||||
ports:
|
||||
- {name: ops, containerPort: 9100}
|
||||
startupProbe:
|
||||
httpGet: {path: /livez, port: ops}
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 8
|
||||
failureThreshold: 12
|
||||
readinessProbe:
|
||||
httpGet: {path: /readyz, port: ops}
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 8
|
||||
failureThreshold: 1 # Any doubt about authority removes the pod at once.
|
||||
livenessProbe:
|
||||
httpGet: {path: /livez, port: ops}
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 8
|
||||
failureThreshold: 6
|
||||
resources:
|
||||
requests: {cpu: 250m, memory: 128Mi}
|
||||
limits: {cpu: "1", memory: 512Mi}
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities: {drop: [ALL]}
|
||||
volumeMounts:
|
||||
- {name: connection, mountPath: /run/postgres, readOnly: true}
|
||||
- {name: private, mountPath: /run/evo, readOnly: true}
|
||||
- {name: objects, mountPath: /var/lib/evolution/objects}
|
||||
- {name: scratch, mountPath: /tmp}
|
||||
volumes:
|
||||
- name: connection
|
||||
secret:
|
||||
secretName: evolution-postgres-runtime # Runtime login only; never migrator.
|
||||
defaultMode: 0440
|
||||
items:
|
||||
- {key: pgpass, path: pgpass}
|
||||
- {key: ca.crt, path: ca.crt}
|
||||
- name: private
|
||||
emptyDir: {medium: Memory, sizeLimit: 1Mi}
|
||||
- name: objects
|
||||
persistentVolumeClaim: {claimName: evolution-region-objects}
|
||||
- name: scratch
|
||||
emptyDir: {medium: Memory, sizeLimit: 8Mi}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: evolution-region-7-1
|
||||
namespace: evolution-dev
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels: {app.kubernetes.io/name: evolution-region, evolution.aeternalis/region: "7-1"}
|
||||
policyTypes: [Ingress, Egress]
|
||||
ingress:
|
||||
# Metrics/probes only from the monitoring namespace (kubelet probes use the node).
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels: {kubernetes.io/metadata.name: monitoring}
|
||||
ports: [{port: 9100, protocol: TCP}]
|
||||
egress:
|
||||
# Replace with the actual database endpoint; no DNS is needed with a numeric hostaddr.
|
||||
- to: [{ipBlock: {cidr: 192.0.2.10/32}}]
|
||||
ports: [{port: 5432, protocol: TCP}]
|
||||
Reference in New Issue
Block a user