Files
bakery-ia/infrastructure/kubernetes/base/migrations/tenant-seed-pilot-coupon-job.yaml

77 lines
2.1 KiB
YAML
Raw Normal View History

2025-10-17 18:14:28 +02:00
# Seed job for PILOT2025 coupon - runs after tenant migration
apiVersion: batch/v1
kind: Job
metadata:
name: tenant-seed-pilot-coupon
namespace: bakery-ia
labels:
app.kubernetes.io/name: tenant-seed-pilot-coupon
app.kubernetes.io/component: seed
app.kubernetes.io/part-of: bakery-ia
spec:
backoffLimit: 3
template:
metadata:
labels:
app.kubernetes.io/name: tenant-seed-pilot-coupon
app.kubernetes.io/component: seed
spec:
imagePullSecrets:
- name: dockerhub-creds
2025-10-18 16:03:23 +02:00
serviceAccountName: demo-seed-sa
2025-10-17 18:14:28 +02:00
initContainers:
2025-11-06 11:04:50 +01:00
- name: wait-for-tenant-migration
image: busybox:1.36
command:
- sh
- -c
- |
echo "Waiting 30 seconds for tenant-migration to complete..."
sleep 30
2025-10-17 18:14:28 +02:00
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"
2025-11-06 11:04:50 +01:00
- name: wait-for-tenant-service
image: curlimages/curl:latest
command:
- sh
- -c
- |
echo "Waiting for tenant-service to be ready..."
until curl -f http://tenant-service.bakery-ia.svc.cluster.local:8000/health/ready > /dev/null 2>&1; do
echo "tenant-service not ready yet, waiting..."
sleep 5
done
echo "tenant-service is ready!"
2025-10-17 18:14:28 +02:00
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"
containers:
- name: seed-coupon
image: bakery/tenant-service:dev
2025-10-18 16:03:23 +02:00
command: ["python", "/app/scripts/seed_pilot_coupon.py"]
2025-10-17 18:14:28 +02:00
env:
- name: TENANT_DATABASE_URL
valueFrom:
secretKeyRef:
name: database-secrets
key: TENANT_DATABASE_URL
- name: LOG_LEVEL
value: "INFO"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
restartPolicy: OnFailure