Add M8.3 dev/stage stores: Retain volumes, free-space reserve, store check

Keep the filesystem object store on a node-local Retain-class PVC per
environment (ADR-0070), with the database on the external PostgreSQL VM.
Because local-path does not enforce sizes, the object store now refuses
new objects below a free-space reserve with a distinct full error, so a
full volume publishes and acknowledges nothing. evo-world-clone gains
check-store to qualify volume retention, reserve, database version/TLS
and the runtime privilege boundary from inside the cluster; it now ships
in the server image. Add the storage class, object claims, hand-applied
store Jobs, policy rules forbidding password env vars, and the runbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-29 13:51:15 -04:00
co-authored by Claude Opus 5.5
parent 9d9e00c307
commit 2d950060db
23 changed files with 833 additions and 24 deletions
+25
View File
@@ -145,6 +145,31 @@ for path, doc in objects:
check(destination != 'evolution-world0' or name == 'aevolution-world0',
f'{path}: only aevolution-world0 may target evolution-world0')
# M8.3 storage (ADR-0070): durable volumes retain their data; database passwords are
# only ever mounted as files, never placed in the environment.
classes = {d['metadata']['name']: d for p, d in objects if d['kind'] == 'StorageClass'}
retain = classes.get('aevolution-local-retain')
check(retain is not None and retain.get('reclaimPolicy') == 'Retain'
and retain.get('volumeBindingMode') == 'WaitForFirstConsumer'
and 'storageclass.kubernetes.io/is-default-class' not in retain['metadata'].get('annotations', {}),
'aevolution-local-retain must be a non-default Retain class that binds on first consumer')
for path, doc in objects:
if doc['kind'] == 'PersistentVolumeClaim' and path.startswith(platform + '/'):
check(doc['spec'].get('storageClassName') == 'aevolution-local-retain',
f'{path}: platform volumes must use aevolution-local-retain')
if doc['kind'] in ('Job', 'Deployment', 'StatefulSet', 'Pod'):
pod = doc['spec'].get('template', {}).get('spec', doc['spec'])
for container in pod.get('containers', []) + pod.get('initContainers', []):
check(not any('secretRef' in source for source in container.get('envFrom', [])),
f'{path}: never import a whole Secret into the environment')
for variable in container.get('env', []):
ref = variable.get('valueFrom', {}).get('secretKeyRef', {})
check(ref.get('key') not in ('PGPASSWORD', 'POSTGRES_PASSWORD', 'PGUSER', 'POSTGRES_USER'),
f'{path}: {variable.get("name")} must not come from {ref.get("key")}')
if pod.get('volumes') and 'store' in doc['metadata'].get('name', ''):
check(doc['metadata'].get('namespace') != 'evolution-world0',
f'{path}: store Jobs never target World0')
# The live Argo path.
for path, doc in objects:
if path.startswith('deploy/kubernetes/dev/'):
+8
View File
@@ -15,11 +15,19 @@ code=$?
set -e
test "$code" -eq 2
grep -q '^usage: evo-server ' <<<"$usage"
# The bundled operations tool refuses to run without a subcommand too (M8.3).
set +e
tool="$(run --entrypoint /usr/local/bin/evo-world-clone "$image" 2>&1)"
code=$?
set -e
test "$code" -eq 2
grep -q '^usage: evo-world-clone ' <<<"$tool"
# Non-root, every shared library resolved, no credential material in the image.
run --entrypoint /bin/sh "$image" -c '
set -eu
test "$(id -u)" = 10001 && test "$(id -g)" = 10001
! ldd /usr/local/bin/evo-server | grep -q "not found"
! ldd /usr/local/bin/evo-world-clone | grep -q "not found"
test -z "$(find / -xdev \( -name "*pgpass*" -o -name "pg_service.conf" -o -name "*.pem" \
-o -name "*.key" \) -not -path "/etc/ssl/*" -not -path "/usr/share/*" -print 2>/dev/null)"
'