# HG changeset patch # User drewp@bigasterisk.com # Date 1721448069 25200 # Node ID a527228aa353bcaa0bdaf29e7d2bfcb1584933bd # Parent 0d72635fc5019686d980635daa2794856bbd95af prefect use postgres diff -r 0d72635fc501 -r a527228aa353 k8s/deploy.yaml --- a/k8s/deploy.yaml Fri Jul 19 00:59:45 2024 -0700 +++ b/k8s/deploy.yaml Fri Jul 19 21:01:09 2024 -0700 @@ -4,6 +4,7 @@ name: sco-bot spec: replicas: 1 + strategy: {type: Recreate} selector: matchLabels: app: sco-bot @@ -49,6 +50,21 @@ - name: sco-bot-data mountPath: /opt/data + - name: prefect-db + securityContext: + runAsUser: 70 # = postgres user, needed to write to /var/run in the container + image: postgres:16.3-alpine + env: + - { name: PGDATA, value: /opt/data/postgres/data } + - { name: POSTGRES_USER, value: postgres } + - { name: POSTGRES_PASSWORD, value: admin } + - { name: POSTGRES_DB, value: prefect } + ports: + - containerPort: 5432 + volumeMounts: + - name: sco-bot-data + mountPath: /opt/data + - name: prefect image: reg:5000/sco_bot_server securityContext: { runAsUser: 1020 } @@ -56,6 +72,8 @@ env: - name: PREFECT_API_URL value: https://sco-bot-prefect.bigasterisk.com/api + - name: PREFECT_API_DATABASE_CONNECTION_URL + value: "postgresql+asyncpg://postgres:admin@localhost:5432/prefect" command: - pdm - run_prefect_server @@ -73,6 +91,8 @@ env: - name: PREFECT_API_URL value: http://localhost:4200/api + - name: PREFECT_API_DATABASE_CONNECTION_URL + value: "postgresql+asyncpg://postgres:admin@localhost:5432/prefect" command: - pdm - run_build_flow