56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: demo-seed-alerts-retail
|
|
namespace: bakery-ia
|
|
labels:
|
|
app: demo-seed
|
|
component: initialization
|
|
tier: retail
|
|
annotations:
|
|
"helm.sh/hook": post-install,post-upgrade
|
|
"helm.sh/hook-weight": "56" # After retail forecasts (55)
|
|
spec:
|
|
ttlSecondsAfterFinished: 3600
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: demo-seed-alerts-retail
|
|
spec:
|
|
initContainers:
|
|
- name: wait-for-alert-processor-service
|
|
image: curlimages/curl:latest
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
echo "Waiting for alert-processor-api to be ready..."
|
|
until curl -f http://alert-processor-api.bakery-ia.svc.cluster.local:8010/health > /dev/null 2>&1; do
|
|
echo "alert-processor-api not ready yet, waiting..."
|
|
sleep 5
|
|
done
|
|
echo "alert-processor-api is ready!"
|
|
containers:
|
|
- name: seed-alerts-retail
|
|
image: bakery/alert-processor:latest
|
|
command: ["python", "/app/scripts/demo/seed_demo_alerts_retail.py"]
|
|
env:
|
|
- name: ALERT_PROCESSOR_DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: database-secrets
|
|
key: ALERT_PROCESSOR_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
|