1
0

alembic-migrate-job.yaml 782 B

123456789101112131415161718192021222324252627282930313233
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: alembic-migrate
  5. namespace: food-ai
  6. spec:
  7. backoffLimit: 2
  8. template:
  9. spec:
  10. restartPolicy: Never
  11. containers:
  12. - name: alembic
  13. image: food-ai-app:latest
  14. command: ["alembic", "-c", "/app/alembic.ini", "upgrade", "head"]
  15. env:
  16. - name: MYSQL_ROOT_PASSWORD
  17. valueFrom:
  18. secretKeyRef:
  19. name: food-ai-secrets
  20. key: MYSQL_ROOT_PASSWORD
  21. - name: LOG_PATH
  22. value: "/logs"
  23. volumeMounts:
  24. - name: logs
  25. mountPath: /logs
  26. resources:
  27. limits:
  28. cpu: "500m"
  29. memory: "512Mi"
  30. volumes:
  31. - name: logs
  32. persistentVolumeClaim:
  33. claimName: logs-pvc