Because I pushed the environment variable changes to the cluster already, psycopg2 was automatically trying to connect to the database using the file specified in PGSSLROOTCERT. That ConfigMap was not mounted into the migrations container, so I'm doing that here.
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: migration
|
|
namespace: atat
|
|
spec:
|
|
ttlSecondsAfterFinished: 100
|
|
backoffLimit: 2
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: migration
|
|
image: $CONTAINER_IMAGE
|
|
command: [
|
|
"/bin/sh", "-c"
|
|
]
|
|
args:
|
|
- |
|
|
/opt/atat/atst/.venv/bin/python \
|
|
/opt/atat/atst/.venv/bin/alembic \
|
|
upgrade head \
|
|
&& \
|
|
/opt/atat/atst/.venv/bin/python \
|
|
/opt/atat/atst/script/seed_roles.py
|
|
envFrom:
|
|
- configMapRef:
|
|
name: atst-envvars
|
|
- configMapRef:
|
|
name: atst-worker-envvars
|
|
volumeMounts:
|
|
- name: atst-config
|
|
mountPath: "/opt/atat/atst/atst-overrides.ini"
|
|
subPath: atst-overrides.ini
|
|
- name: pgsslrootcert
|
|
mountPath: "/opt/atat/atst/ssl/pgsslrootcert.crt"
|
|
subPath: pgsslrootcert.crt
|
|
volumes:
|
|
- name: atst-config
|
|
secret:
|
|
secretName: atst-config-ini
|
|
items:
|
|
- key: override.ini
|
|
path: atst-overrides.ini
|
|
mode: 0644
|
|
- name: pgsslrootcert
|
|
configMap:
|
|
name: pgsslrootcert
|
|
items:
|
|
- key: cert
|
|
path: pgsslrootcert.crt
|
|
mode: 0666
|
|
restartPolicy: Never
|