67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
|
|
apiVersion: batch/v1
|
||
|
|
kind: Job
|
||
|
|
metadata:
|
||
|
|
name: demo-seed-production-batches
|
||
|
|
namespace: bakery-ia
|
||
|
|
labels:
|
||
|
|
app: demo-seed
|
||
|
|
component: initialization
|
||
|
|
annotations:
|
||
|
|
"helm.sh/hook": post-install,post-upgrade
|
||
|
|
"helm.sh/hook-weight": "30" # After equipment (25) and other dependencies
|
||
|
|
spec:
|
||
|
|
ttlSecondsAfterFinished: 3600
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: demo-seed-production-batches
|
||
|
|
spec:
|
||
|
|
initContainers:
|
||
|
|
- name: wait-for-production-migration
|
||
|
|
image: busybox:1.36
|
||
|
|
command:
|
||
|
|
- sh
|
||
|
|
- -c
|
||
|
|
- |
|
||
|
|
echo "Waiting 30 seconds for production-migration to complete..."
|
||
|
|
sleep 30
|
||
|
|
- name: wait-for-tenant-seed
|
||
|
|
image: busybox:1.36
|
||
|
|
command:
|
||
|
|
- sh
|
||
|
|
- -c
|
||
|
|
- |
|
||
|
|
echo "Waiting 15 seconds for demo-seed-tenants to complete..."
|
||
|
|
sleep 15
|
||
|
|
- name: wait-for-recipes-seed
|
||
|
|
image: busybox:1.36
|
||
|
|
command:
|
||
|
|
- sh
|
||
|
|
- -c
|
||
|
|
- |
|
||
|
|
echo "Waiting 10 seconds for recipes seed to complete..."
|
||
|
|
sleep 10
|
||
|
|
containers:
|
||
|
|
- name: seed-production-batches
|
||
|
|
image: bakery/production-service:latest
|
||
|
|
command: ["python", "/app/scripts/demo/seed_demo_batches.py"]
|
||
|
|
env:
|
||
|
|
- name: PRODUCTION_DATABASE_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: database-secrets
|
||
|
|
key: PRODUCTION_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
|