apiVersion: batch/v1
kind: CronJob
metadata:
  name: tweet-taiwan-covid19-vaccination-progress
spec:
  schedule: "30 11 * * *"
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 2
  failedJobsHistoryLimit: 2
  jobTemplate:
    spec:
      template:
        spec:
          volumes:
            - name: sns-tokens
              secret:
                secretName: taiwan-covid19-vaccination-progress-bot-sns-tokens
          containers:
            - name: taiwan-covid19-vaccination-progress-bot
              image: gugod/taiwan-covid19-vaccination-progress-bot:latest
              command:
                - perl
                - /app/bin/tweet.pl
                - '--twitter-config'
                - /app/secrets/twitter-token.yml
                - '--mastodon-config'
                - /app/secrets/mastodon-token.yml
                - '--yes'
              volumeMounts:
                - name: sns-tokens
                  mountPath: /app/secrets
                  readOnly: true
          restartPolicy: Never
