At the maintainer's request everything but Secrets and the store node label now goes through Argo CD. aevolution-platform syncs one bundle (World0 admission policy, Retain storage class, each environment's namespace, guardrails, service accounts and object claim) with self-heal, no prune and Prune=false,Delete=false on every object; the admission policy also protects the platform app and project. Store Jobs become kustomize components used as PreSync (migrate) and PostSync (check-store) hooks per environment, and the policy check refuses any unresolved marker in a path an Application syncs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61 lines
2.1 KiB
YAML
61 lines
2.1 KiB
YAML
# PreSync hook: every sync of the environment first migrates its database with the
|
|
# migrator login (version pin and runtime privilege audit included); a failure
|
|
# stops the sync before anything else changes.
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: aevolution-db-migrate
|
|
labels:
|
|
app.kubernetes.io/part-of: aevolution
|
|
app.kubernetes.io/component: migrate
|
|
annotations:
|
|
argocd.argoproj.io/hook: PreSync
|
|
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
|
spec:
|
|
backoffLimit: 0
|
|
activeDeadlineSeconds: 180
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/part-of: aevolution
|
|
app.kubernetes.io/component: migrate
|
|
spec:
|
|
serviceAccountName: aevolution-migrator
|
|
automountServiceAccountToken: false
|
|
restartPolicy: Never
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 10001
|
|
runAsGroup: 10001
|
|
fsGroup: 10001
|
|
seccompProfile: {type: RuntimeDefault}
|
|
containers:
|
|
- name: migrate
|
|
image: aevolution-postgres-tools
|
|
env:
|
|
- {name: PGSERVICE, value: evolution}
|
|
- {name: PGSERVICEFILE, value: /run/postgres/pg_service.conf}
|
|
- {name: EVO_PGPASS_SOURCE, value: /run/postgres/pgpass}
|
|
- {name: EVO_PG_RUNTIME_ROLE, value: set-by-overlay}
|
|
resources:
|
|
requests: {cpu: 100m, memory: 64Mi}
|
|
limits: {memory: 128Mi}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities: {drop: [ALL]}
|
|
volumeMounts:
|
|
- {name: connection, mountPath: /run/postgres, readOnly: true}
|
|
- {name: scratch, mountPath: /tmp}
|
|
volumes:
|
|
- name: connection
|
|
secret:
|
|
secretName: evolution-postgres-migrator
|
|
defaultMode: 0440
|
|
items:
|
|
- {key: pg_service.conf, path: pg_service.conf}
|
|
- {key: pgpass, path: pgpass}
|
|
- {key: ca.crt, path: ca.crt}
|
|
- name: scratch
|
|
emptyDir: {medium: Memory, sizeLimit: 8Mi}
|