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

68 lines
1.9 KiB
YAML
Raw Normal View History

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
2025-12-05 20:07:01 +01:00
- name: wait-for-alert-processor
image: curlimages/curl:latest
command:
- sh
- -c
- |
2025-12-05 20:07:01 +01:00
echo "Waiting for alert-processor to be ready..."
until curl -f http://alert-processor.bakery-ia.svc.cluster.local:8000/health > /dev/null 2>&1; do
echo "alert-processor not ready yet, waiting..."
sleep 5
done
2025-12-05 20:07:01 +01:00
echo "alert-processor 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