apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: auto-deploy-v0-5
  clusterName: kubeflow-testing
  namespace: kubeflow-test-infra
spec:
  concurrencyPolicy: Forbid
  schedule: 0 */12 * * *
  jobTemplate:
    spec:
      backoffLimit: 2
      template:
        spec:
          containers:
          - name: deploy-worker
            image: gcr.io/kubeflow-ci/deploy-worker:v20190404-cda5cee-e3b0c4
            env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /secret/gcp-credentials/key.json
            command:
            - /usr/local/bin/auto_deploy.sh
            - --repos=kubeflow/kubeflow@v0.5-branch;kubeflow/testing
            - --project=kubeflow-ci-deployment
            - --job_labels=/etc/pod-info/labels
            - --data_dir=/mnt/test-data-volume/auto_deploy
            - --base_name=kf-v0-5
            - --max_num_cluster=5
            - --zone=us-east1-b
            - --github_token_file=/secret/github-token/github_token
            volumeMounts:
            - name: gcp-credentials
              mountPath: /secret/gcp-credentials
              readOnly: true
            - name: oauth-secret
              mountPath: /secret/oauth-secret
              readOnly: true
            - name: pod-info
              mountPath: /etc/pod-info
              readOnly: true
            - name: github-token
              mountPath: /secret/github-token
              readOnly: true
            - name: test-data-volume
              mountPath: /mnt/test-data-volume
              readOnly: false
          restartPolicy: Never
          volumes:
          - name: gcp-credentials
            secret:
              secretName: gcp-credentials
          - name: oauth-secret
            secret:
              secretName: kubeflow-ci-deployment-iap-testing-oauth
          - name: github-token
            secret:
              secretName: github-token
          - name: test-data-volume
            persistentVolumeClaim:
              claimName: nfs-external
          - name: pod-info
            downwardAPI:
              items:
              - path: labels
                fieldRef:
                  fieldPath: metadata.labels
