---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: snow-keepalive
spec:
  # Time is measured in coordinated universal time (UTC)
  #          ┌───────────── minute (0 - 59)
  #          │ ┌───────────── hour (0 - 23)
  #          │ │ ┌───────────── day of the month (1 - 31)
  #          │ │ │ ┌───────────── month (1 - 12)
  #          │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
  schedule: "0 0 * * *"
  jobTemplate:
    spec:
      backoffLimit: 1
      completions: 1
      parallelism: 1
      template:
        spec:
          containers:
          - env:
            - name: TOWER_OAUTH_TOKEN
              value: YOUR_ANSIBLE_TOWER_TOKEN_GOES_HERE
            - name: TOWER_HOST
              value: URL_FOR_YOUR_ANSIBLE_TOWER
            - name: TOWER_JOB_TEMPLATE_NAME
              value: JOB_TEMPLATE_NAME_FOUND_IN_TOWER
            - name: TOWER_VERIFY_SSL
              value: "False"
            - name: ANSIBLEJOB_NAME
              value: snow-keepalive
            - name: ANSIBLEJOB_NAMESPACE
              value: NAMESPACE_WHERE_THE_ANSIBLEJOB_KIND_IS_CREATED
            image: quay.io/open-cluster-management/platform-resource-runner:latest
            imagePullPolicy: Always
            name: snow-keepalive
            resources: {}
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
          dnsPolicy: ClusterFirst
          restartPolicy: Never
          schedulerName: default-scheduler
          securityContext: {}
          serviceAccount: tower-resource-operator
          serviceAccountName: tower-resource-operator
          terminationGracePeriodSeconds: 30