apiVersion: batch/v1 kind: Job metadata: name: demo-seed-alerts namespace: bakery-ia labels: app: demo-seed component: initialization annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "28" # After orchestration runs (27), as alerts reference recent data spec: ttlSecondsAfterFinished: 3600 template: metadata: labels: app: demo-seed-alerts spec: initContainers: - name: wait-for-alert-processor-migration image: busybox:1.36 command: - sh - -c - | echo "Waiting 30 seconds for alert-processor-migration to complete..." sleep 30 - name: wait-for-alert-processor-api 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 image: bakery/alert-processor:latest command: ["python", "/app/scripts/demo/seed_demo_alerts.py"] env: - name: ALERT_PROCESSOR_DATABASE_URL valueFrom: secretKeyRef: name: database-secrets key: ALERT_PROCESSOR_DATABASE_URL - name: 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