apiVersion: v1
kind: Pod
metadata:
  name: fc-addqueue
  namespace: alchemist-processor
  labels:
    app: fc-addqueue
  annotations:
    iam.amazonaws.com/role: svc-sandbox-alchemist
spec:
  containers:
  - name:  alchemist-addqueue
    image: opendatacube/datacube-alchemist:latest
    args:
      - datacube-alchemist
      - addtoqueue
      - 'time in 2018-01-20'
      # - 'time in 2018-01-20' # works
      - 'lon in range(152.4,152.5)'
      - 'lat in range(-28,-27.1)'
      # - 'time in [2019-01-01,2019-01-31]'
    resources:
      requests:
        cpu: 1
        memory: 512Mi
      limits:
        memory: 4048Mi
    tty: true
    stdin: true
    env:
    - name: AWS_DEFAULT_REGION
      valueFrom:
        secretKeyRef:
          name: svc-sandbox-alchemist
          key: AWS_DEFAULT_REGION
    - name: ALCHEMIST_ADDTOQUEUE_MESSAGE_QUEUE
      value: "alchemist-standard"
    - name: ALCHEMIST_ADDTOQUEUE_ENVIRONMENT
      value: "datacube"
    - name: ALCHEMIST_ADDTOQUEUE_LIMIT
    # Here's the LIMIT! 
      value: "999999"
    - name: ALCHEMIST_ADDTOQUEUE_CONFIG_FILE
    # Need to add both A and B
      # value: "https://raw.githubusercontent.com/opendatacube/datacube-alchemist/master/examples/fc_config_sentinel2a_alex.yaml"
      value: "https://raw.githubusercontent.com/opendatacube/datacube-alchemist/master/examples/fc_config_sentinel2a_dsg_test.yaml"
    - name: DB_USERNAME
      valueFrom:
        secretKeyRef:
          name: sandbox-datacube
          key: postgres-username
    - name: DB_PASSWORD
      valueFrom:
        secretKeyRef:
          name: sandbox-datacube
          key: postgres-password
    - name: DATACUBE_CONFIG_PATH
      value: "/opt/custom-config.conf"
    - name: DB_DATABASE
      value: "sandbox"
    - name: DB_HOSTNAME
      value: "database.local"
    - name: DB_PORT
      value: "5432"
    - name: AWS_ACCESS_KEY_ID
      valueFrom:
        secretKeyRef:
          name: svc-sandbox-alchemist
          key: AWS_ACCESS_KEY_ID
    - name: AWS_SECRET_ACCESS_KEY
      valueFrom:
        secretKeyRef:
          name: svc-sandbox-alchemist
          key: AWS_SECRET_ACCESS_KEY
    - name: LOG_LEVEL
      value: "INFO"
  nodeSelector:
    beta.kubernetes.io/os: linux
  restartPolicy: Never
