apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: azure-purge
  namespace: azure
spec:
  schedule: "0 15 * * *" 
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 2
  jobTemplate:             
    spec:
      template:
        metadata:
          labels:
            name: azure-purge
        spec:
          containers:
          - name: azure-purge
            image: registry.svc.ci.openshift.org/azure/azure-misc:purge
            env:
            - name: AZURE_TENANT_ID
              valueFrom:
                secretKeyRef:
                  name: cluster-secrets-azure-env
                  key: azure_tenant_id
            - name: AZURE_SUBSCRIPTION_ID
              valueFrom:
                secretKeyRef:
                  name: cluster-secrets-azure-env
                  key: azure_subscription_id
            - name: AZURE_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: cluster-secrets-azure-env
                  key: azure_client_id
            - name: AZURE_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: cluster-secrets-azure-env
                  key: azure_client_secret
          restartPolicy: Never
