---

apiVersion: batch/v1
kind: CronJob
metadata:
    name: workfinder-landsat8
spec:
    schedule: "*/5 * * * *"
    concurrencyPolicy: Forbid
    jobTemplate:
        spec:
            template:
                spec:
                    containers:
                        -   name: workfinder-landsat8
                            image: "satapps/workfinder:0.2.12"
                            imagePullPolicy: IfNotPresent
                            command:
                                - python
                                - -m
                                - workfinder.workfinder
                                - --limit
                                - "1"
                                - landsat8
                            env:
                                -   name: APP_REGION
                                    value: "Fiji"
                                -   name: AWS_BUCKET
                                    value: "public-eo-data"
                                -   name: AWS_ACCESS_KEY_ID
                                    valueFrom:
                                        secretKeyRef:
                                            name: s3-secrets
                                            key: access-key
                                -   name: AWS_SECRET_ACCESS_KEY
                                    valueFrom:
                                        secretKeyRef:
                                            name: s3-secrets
                                            key: secret-key
                                -   name: USGS_USERNAME
                                    valueFrom:
                                        secretKeyRef:
                                            name: usgs-secrets
                                            key: username
                                -   name: USGS_PASSWORD
                                    valueFrom:
                                        secretKeyRef:
                                            name: usgs-secrets
                                            key: password
                                -   name: NATS_URL
                                    value: "nats://something.something.com"
                                -   name: REDIS_HOST
                                    value: "redis-master.ard.svc.cluster.local"
                                -   name: REDIS_PORT
                                    value: "6379"
                    restartPolicy: Never

