Files
aevolution/deploy/kubernetes/admin-portal-dev/deployment.yaml
T
dingoandClaude Opus 5.5 9b854e6960
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m31s
Foundation / postgres-tools (push) Successful in 27s
Foundation / server-image (push) Successful in 4m33s
Foundation / image (push) Successful in 5m39s
feat(admin): open a fresh region from the portal (ADR-0182 section 15)
The Regions page opens the next region in place of the one DEV serves: the
admin API reads the region overlay, its kustomization, the grant broker and the
portal deployment from main at one commit, rewrites only the region id, routes,
genesis commit and seeded wildlife range (refusing files whose layout differs),
commits them in one Gitea multi-file commit as aevolution-bot, then starts a full
Argo sync of exactly that commit. The page follows the sync until the region is
live, across the portal's own restart.

Credentials come from Secret aevolution-admin mounted read-only as files
(--deploy-config); without it the feature stays off. A small OpenSSL HTTPS
client talks to Gitea (verified) and argocd-server (verification per
ARGOCD_TLS_VERIFY). The portal's NetworkPolicy gains egress to the node's
ingress for Gitea and to the argocd-server pods, as approved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 13:51:36 -04:00

117 lines
5.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 \
--region-tuning /etc/evo/tuning/cellular.tuning \
--deploy-config /run/deploy "${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); the region tuning file, shown read only.
- {name: tuning, mountPath: /etc/evo/tuning, readOnly: true}
# ADR-0182 section 15: the Gitea and Argo CD settings and tokens that let the portal
# open a region, one file per key; without the Secret that feature stays off.
- {name: deploy, mountPath: /run/deploy, readOnly: true}
volumes:
- name: deploy
secret:
secretName: aevolution-admin
optional: true
defaultMode: 0440
items:
- {key: GITEA_BASE_URL, path: GITEA_BASE_URL}
- {key: GITEA_REPOSITORY, path: GITEA_REPOSITORY}
- {key: GITEA_TOKEN, path: GITEA_TOKEN}
- {key: ARGOCD_SERVER, path: ARGOCD_SERVER}
- {key: ARGOCD_APPLICATION, path: ARGOCD_APPLICATION}
- {key: ARGOCD_TOKEN, path: ARGOCD_TOKEN}
- {key: ARGOCD_TLS_VERIFY, path: ARGOCD_TLS_VERIFY}
- name: tuning
configMap:
name: cellular-tuning
defaultMode: 0444
items:
- {key: cellular-revamp.tuning, path: cellular-revamp.tuning}
- {key: cellular.tuning, path: cellular.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}