Files
bakery-ia/infrastructure/kubernetes/base/jobs/demo-seed-distribution-history-job.yaml

65 lines
1.9 KiB
YAML
Raw Normal View History

2025-11-30 09:12:40 +01:00
apiVersion: batch/v1
kind: Job
metadata:
name: demo-seed-distribution-history
namespace: bakery-ia
labels:
app: demo-seed
component: initialization
tier: enterprise
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "57" # After all retail seeds (56) - CRITICAL for enterprise demo
spec:
ttlSecondsAfterFinished: 3600
template:
metadata:
labels:
app: demo-seed-distribution-history
spec:
initContainers:
- name: wait-for-distribution-service
image: curlimages/curl:latest
command:
- sh
- -c
- |
echo "Waiting for distribution-service to be ready..."
until curl -f http://distribution-service.bakery-ia.svc.cluster.local:8000/health > /dev/null 2>&1; do
echo "distribution-service not ready yet, waiting..."
sleep 5
done
echo "distribution-service is ready!"
- name: wait-for-all-retail-seeds
image: busybox:1.36
command:
- sh
- -c
- |
echo "Waiting 60 seconds for all retail seeds to complete..."
echo "This ensures distribution history has all child data in place"
sleep 60
containers:
- name: seed-distribution-history
image: bakery/distribution-service:latest
command: ["python", "/app/scripts/demo/seed_demo_distribution_history.py"]
env:
- name: DISTRIBUTION_DATABASE_URL
valueFrom:
secretKeyRef:
name: database-secrets
key: DISTRIBUTION_DATABASE_URL
- name: DEMO_MODE
value: "production"
- name: LOG_LEVEL
value: "INFO"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
restartPolicy: OnFailure
serviceAccountName: demo-seed-sa