Files
trade-gitops/environments/sol/trade-r001-canary/hasura-bootstrap-job.yaml
mpabi e1e993e2ac
Some checks failed
deploy-trade-r001-canary / apply (push) Failing after 5m41s
feat(sol): add agave-backed dlob hot path for canary
2026-04-12 18:10:42 +02:00

67 lines
1.9 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: hasura-bootstrap
namespace: trade-r001-canary
spec:
backoffLimit: 5
template:
spec:
restartPolicy: OnFailure
initContainers:
- name: wait-db
image: postgres:16
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: trade-postgres
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
command:
- sh
- -ec
- |
export PGPASSWORD="$POSTGRES_PASSWORD"
until pg_isready -h postgres -U "$POSTGRES_USER" -d "$POSTGRES_DB"; do sleep 1; done
until psql -h postgres -U "$POSTGRES_USER" -d "$POSTGRES_DB" -v ON_ERROR_STOP=1 -c "select 1 from public.drift_ticks limit 1" >/dev/null 2>&1; do sleep 1; done
containers:
- name: hasura-bootstrap
image: node:20-slim
imagePullPolicy: IfNotPresent
env:
- name: HASURA_URL
value: http://hasura:8080
- name: HASURA_ADMIN_SECRET
valueFrom:
secretKeyRef:
name: trade-hasura
key: HASURA_GRAPHQL_ADMIN_SECRET
- name: TICKS_TABLE
value: drift_ticks
- name: CANDLES_FUNCTION
value: get_drift_candles
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
command:
- node
- /app/hasura-bootstrap.mjs
volumeMounts:
- name: script
mountPath: /app/hasura-bootstrap.mjs
subPath: hasura-bootstrap.mjs
readOnly: true
volumes:
- name: script
configMap:
name: hasura-bootstrap-script