---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: jira-reporter
  labels:
    team: platform
spec:
  schedule: "5 * * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    metadata:
      labels:
        team: platform
    spec:
      template:
        metadata:
          labels:
            team: platform
        spec:
          serviceAccountName: k8s-pod
          initContainers:
          - args:
            - secret/app/prod/jira-reporter
            env:
            - name: VAULT_ADDR
              value: active.vault.service.sjc.consul:8200
            - name: ENV
              value: prod
            name: secrets
            image: artifactory.wikia-inc.com/ops/init-vault:0.0.42
            imagePullPolicy: Always
            volumeMounts:
            - name: secrets-dir
              mountPath: /var/lib/secrets
          containers:
          - name: jira-reporter
            image: artifactory.wikia-inc.com/sus/jira-reporter:latest
            volumeMounts:
            - name: secrets-dir
              readOnly: true
              mountPath: /var/lib/secrets
            resources:
              limits:
                memory: 3000Mi
              requests:
                memory: 2000Mi
          volumes:
          - name: secrets-dir
            emptyDir:
              medium: Memory
          restartPolicy: Never
