apiVersion: batch/v1
kind: Job
metadata:
  name: iioat-populate
spec:
  template:
    spec:
      containers:
        - name: iioat-populate
          image: ignitial/iioat:IIOS_APP_VERSION
          command: ["npm"]
          args: ["run", "prod:config:populate"]
          imagePullPolicy: Never
          env:
            - name: POPULATE_ALL
              value: "true"
            - name: IIOS_NAMESPACE
              value: "iioat"
            - name: REDIS_HOST
              value: "redis.default.svc.cluster.local"
            - name: REDIS_PORT
              value: "6379"
            - name: MONGODB_URI
              value: "iiomc1-hvphm.gcp.mongodb.net"
            - name: MONGODB_USER
              value: "ignitial"
            - name: MONGODB_OPTIONS
              value: "retryWrites=true"
            - name: IIOS_DBNAME
              value: "iioat"
            - name: MONGODB_CONN_MAX_ATTEMPTS
              value: "60"
            - name: MONGODB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: iiosecrets
                  key: mongodb_pwd
      restartPolicy: Never
