Files
aevolution/deploy/kubernetes/admin-portal-dev/deployment.yaml
T
dingoandClaude Opus 5.5 7273b157d6
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (checks) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m47s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 4m42s
Foundation / image (push) Successful in 5m55s
feat(admin): live tuning revisions adopted at recorded ticks (schema 66)
ADR-0182 section 13. The admin portal's Tuning page edits the world's
rules-13 tuning (the Git revamp file format); the admin API checks it,
stores an append-only revision and queues an adopt_tuning admin command
(kind 7: revision and rules digest) for every region of the world.

- Lifecycle: adopt_tuning replaces the region's rules after births when
  a resolver names the rules for that revision and digest; the safety
  revision cannot change live. At most one adoption per batch.
- Host: fetches the revision text, rebuilds and digests the rules before
  appending the command; publication and recovery name the rules from
  the successor state, checked against the recorded digest.
- Schema 66: tuning_revisions, admin_set_tuning_v1, load_tuning_revision_v1
  (runtime), admin_tuning_revisions_v1, admin_tuning_text_v1.
- OpsServer: optional bounded request bodies (Content-Length, 413).
- Region view: rules_sha256, so the portal shows each region's revision.
- Portal: Tuning page; baseline from the mounted cellular-revamp.tuning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:35:09 -04:00

98 lines
4.3 KiB
YAML

# ADR-0182 admin API and portal. One replica; it holds no state but a short view
# cache. The realm's public signing key is pinned below (ADMIN_JWKS, the same key as the grant
# broker's); a Keycloak key rotation needs a Git update in both.
apiVersion: apps/v1
kind: Deployment
metadata:
name: evo-admin-portal
annotations:
argocd.argoproj.io/sync-wave: "2" # After migration (schema v61).
labels:
app.kubernetes.io/name: evo-admin-portal
app.kubernetes.io/component: admin-portal
spec:
replicas: 1
revisionHistoryLimit: 3
progressDeadlineSeconds: 180
selector:
matchLabels:
app.kubernetes.io/name: evo-admin-portal
template:
metadata:
labels:
app.kubernetes.io/name: evo-admin-portal
app.kubernetes.io/component: admin-portal
app.kubernetes.io/part-of: aevolution
spec:
serviceAccountName: aevolution-admin-portal
automountServiceAccountToken: false
terminationGracePeriodSeconds: 10
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
seccompProfile: {type: RuntimeDefault}
containers:
- name: evo-admin-api
image: aevolution-server
command: ["/bin/bash", "-c"]
args:
- |
set -eu
regions=()
for region in $ADMIN_REGIONS; do regions+=(--region "$region"); done
exec /usr/local/bin/evo-admin-api --listen 0.0.0.0:8080 --world "$ADMIN_WORLD" \
--jwks "$ADMIN_JWKS" --oidc-issuer "$ADMIN_OIDC_ISSUER" \
--audience aevolution-admin --client aevolution-admin-portal \
--role aevolution-admin --assets /usr/local/share/evo-admin-portal \
--pg-service /run/postgres/pg_service.conf --pg-passfile /run/postgres/pgpass \
--baseline-tuning /etc/evo/tuning/cellular-revamp.tuning "${regions[@]}"
env:
- {name: ADMIN_WORLD, value: "100"}
# Space-separated REGION=HOST:PORT: each region's operations address for /admin/view.
- {name: ADMIN_REGIONS, value: "16=evo-region-ops:9100"}
- {name: ADMIN_OIDC_ISSUER, value: "https://auth.aeternalisgames.com/realms/aeternalis"}
# Public RS256 signing key(s) of realm aeternalis, from its JWKS endpoint.
- name: ADMIN_JWKS
value: '{"keys":[{"alg":"RS256","e":"AQAB","kid":"NGQG4QzQuBCIHVEomUPy-OoWOTVQIuyf3RXqeNbP8JI","kty":"RSA","n":"vvOpu1xxdyH_mB8LkJG6cwc6UVmmAj6mwQi1oEwrpJDLerBI2OZr2kpgMAUJ3-hMIkz5tRtSjHieMFteVrpDDQaCViIPCIvJTL3T7ujTGFNReSE6ho7h0DB_kybFeEWVpLqm6SSXWFYls5TKo6_t8Hw4G3njiRW9pX_NxyaBHqLkrCi63EyIGHOkdgUczg2d4pM4JTt-q25bcFSlYz8bhD3WEORQmbp-bU7aPPluCqCEAZRrbzf8Iy7svNemP5daDdlWQ3LaNy-ixC2HRjiPZdqK5BgAE800BigI-l1dkyJ4X172TLIPVPLW1WKlvdm3kHOpBXwACYiy8boSNDW7gQ","use":"sig"}]}'
ports:
- {name: http, containerPort: 8080, protocol: TCP}
readinessProbe:
httpGet: {path: /healthz, port: http}
periodSeconds: 5
timeoutSeconds: 1
livenessProbe:
httpGet: {path: /healthz, port: http}
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
resources:
requests: {cpu: 10m, memory: 16Mi}
limits: {memory: 128Mi}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: {drop: [ALL]}
volumeMounts:
- {name: connection, mountPath: /run/postgres, readOnly: true}
# The revamp tuning file the regions opened with: the portal's baseline until the
# first tuning revision (ADR-0182 section 13).
- {name: tuning, mountPath: /etc/evo/tuning, readOnly: true}
volumes:
- name: tuning
configMap:
name: cellular-tuning
defaultMode: 0444
items:
- {key: cellular-revamp.tuning, path: cellular-revamp.tuning}
- name: connection
secret:
secretName: aevolution-admin-pg
defaultMode: 0440
items:
- {key: pg_service.conf, path: pg_service.conf}
- {key: pgpass, path: pgpass}
- {key: ca.crt, path: ca.crt}