apiVersion: batch/v1
kind: Job
metadata:
  name: seed-database
spec:
  parallelism: 1
  completions: 1
  activeDeadlineSeconds: 1800
  backoffLimit: 6
  template:
    metadata:
      name: seed-database
    spec:
      containers:
        - name: seed-database
          image: quay.io/smart-city-with-rh-cloud-services/seed-database:latest
          imagePullPolicy: Always
          env:
            - name: DB_HOST
              value: "postgresql"
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-name
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-password
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: postgresql
                  key: database-user
            - name: TABLE_NAME
              value: vehicle_metadata
            - name: VEHICLE_METADATA_DB_URL
              value: https://github.com/red-hat-data-services/smart-city-with-rh-cloud-services/raw/main/source/SC_Seed_Database/vehicle_metadata_db.json
      restartPolicy: Never
