apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: deltweets
spec:
  schedule: "@daily"
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 2
  suspend: false
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: deltweets
            image: "ctadeu/deltweets:0.2"
            imagePullPolicy: Always
            env:
            - name: TWITTER_API_KEY
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWITTER_API_KEY
            - name: TWITTER_API_SECRET
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWITTER_API_SECRET
            - name: TWITTER_ACCESS_TOKEN
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWITTER_ACCESS_TOKEN
            - name: TWITTER_ACCESS_TOKEN_SECRET
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWITTER_ACCESS_TOKEN_SECRET
            - name: TWITTER_USERNAME
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWITTER_USERNAME
            - name: TWEETS_IGNORE
              valueFrom:
                secretKeyRef:
                  name: twittersecrets
                  key: TWEETS_IGNORE
          restartPolicy: Never
