alembic-migrate-job.yaml 855 B

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