apiVersion: batch/v1
kind: Job
metadata:
  name: historical-prices-max
  namespace: {{ .NAMESPACE }}
spec:
  template:
    metadata:
      labels:
        app: historical-prices-max
    spec:
      restartPolicy: Never
      terminationGracePeriodSeconds: 40
      containers:
        - name: historical-prices-max
          image: {{ .IMAGE_NAME }}
          imagePullPolicy: Always
          env:
            - name: ENVIRONMENT
              value: {{ .ENVIRONMENT }}
            - name: P2P_NETWORK
              value: {{ .P2P_NETWORK }}
            - name: LOG_LEVEL
              value: {{ .LOG_LEVEL }}
            - name: JOB_ID
              value: JOB_HISTORICAL_PRICES
            - name: MONGODB_URI
              valueFrom:
                secretKeyRef:
                  name: mongodb
                  key: mongo-uri
            - name: MONGODB_DATABASE
              valueFrom:
                configMapKeyRef:
                  name: config
                  key: mongo-database
            - name: COINGECKO_URL
              value: {{ .COINGECKO_URL }}
            - name: COINGECKO_HEADER_KEY
              value: {{ .COINGECKO_HEADER_KEY }}
            - name: COINGECKO_API_KEY
              valueFrom:
                secretKeyRef:
                  name: jobs
                  key: coingecko-api-key
            - name: REQUEST_LIMIT_TIME_SECONDS
              value: "{{ .REQUEST_LIMIT_TIME_SECONDS }}"
            - name: PRICE_DAYS
              value: "max"
