2025-11-05 13:34:56 +01:00
|
|
|
# Enhanced migration job for ai-insights service with automatic table creation
|
|
|
|
|
apiVersion: batch/v1
|
|
|
|
|
kind: Job
|
|
|
|
|
metadata:
|
Update images for services: ai_insights,alert_processor,auth,demo_session,distribution,external,forecasting,inventory,notification,orchestrator,orders,pos,procurement,production,recipes,sales,suppliers,tenant,training,gateway [skip ci]
2026-01-24 15:18:29 +00:00
|
|
|
name: ai-insights-migration-c5a2dabd
|
2025-11-05 13:34:56 +01:00
|
|
|
namespace: bakery-ia
|
|
|
|
|
labels:
|
Update images for services: ai_insights,alert_processor,auth,demo_session,distribution,external,forecasting,inventory,notification,orchestrator,orders,pos,procurement,production,recipes,sales,suppliers,tenant,training,gateway [skip ci]
2026-01-24 15:18:29 +00:00
|
|
|
app.kubernetes.io/name: ai-insights-migration-c5a2dabd
|
2025-11-05 13:34:56 +01:00
|
|
|
app.kubernetes.io/component: migration
|
|
|
|
|
app.kubernetes.io/part-of: bakery-ia
|
|
|
|
|
spec:
|
|
|
|
|
backoffLimit: 3
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
Update images for services: ai_insights,alert_processor,auth,demo_session,distribution,external,forecasting,inventory,notification,orchestrator,orders,pos,procurement,production,recipes,sales,suppliers,tenant,training,gateway [skip ci]
2026-01-24 15:18:29 +00:00
|
|
|
app.kubernetes.io/name: ai-insights-migration-c5a2dabd
|
2025-11-05 13:34:56 +01:00
|
|
|
app.kubernetes.io/component: migration
|
|
|
|
|
spec:
|
|
|
|
|
initContainers:
|
|
|
|
|
- name: wait-for-db
|
|
|
|
|
image: postgres:17-alpine
|
|
|
|
|
command: ["sh", "-c", "until pg_isready -h ai-insights-db-service -p 5432; do sleep 2; done"]
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
memory: "32Mi"
|
|
|
|
|
cpu: "10m"
|
|
|
|
|
limits:
|
|
|
|
|
memory: "128Mi"
|
|
|
|
|
cpu: "100m"
|
|
|
|
|
containers:
|
|
|
|
|
- name: migrate
|
Update images for services: ai_insights,alert_processor,auth,demo_session,distribution,external,forecasting,inventory,notification,orchestrator,orders,pos,procurement,production,recipes,sales,suppliers,tenant,training,gateway [skip ci]
2026-01-24 15:18:29 +00:00
|
|
|
image: registry.bakewise.ai/bakery-admin/ai_insights:c5a2dabd124a8867c216ee4dc40b576fee619125
|
2025-11-05 13:34:56 +01:00
|
|
|
command: ["python", "/app/shared/scripts/run_migrations.py", "ai_insights"]
|
|
|
|
|
env:
|
|
|
|
|
- name: AI_INSIGHTS_DATABASE_URL
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: database-secrets
|
|
|
|
|
key: AI_INSIGHTS_DATABASE_URL
|
|
|
|
|
- name: DATABASE_URL
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: database-secrets
|
|
|
|
|
key: AI_INSIGHTS_DATABASE_URL
|
|
|
|
|
- name: REDIS_URL
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: database-secrets
|
|
|
|
|
key: REDIS_URL
|
|
|
|
|
- name: DB_FORCE_RECREATE
|
|
|
|
|
valueFrom:
|
|
|
|
|
configMapKeyRef:
|
|
|
|
|
name: bakery-config
|
|
|
|
|
key: DB_FORCE_RECREATE
|
|
|
|
|
optional: true
|
|
|
|
|
- name: LOG_LEVEL
|
|
|
|
|
value: "INFO"
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
memory: "128Mi"
|
|
|
|
|
cpu: "50m"
|
|
|
|
|
limits:
|
|
|
|
|
memory: "512Mi"
|
|
|
|
|
cpu: "500m"
|
|
|
|
|
restartPolicy: OnFailure
|