62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
# Sync hook: the database-egress policy is applied at wave -2, then every sync
|
|
# migrates its database with the migrator login at wave -1; a failure stops the
|
|
# remaining workload sync.
|
|
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: Sync
|
|
argocd.argoproj.io/sync-wave: "-1"
|
|
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}
|