apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: $NAME
  namespace: $NAMESPACE
spec:
  schedule: "$SCHEDULE"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: $CONTAINER
            image: $IMAGE
            env:
              - name: SLACK_TEST_URL
                value: $SLACK_TEST_URL
            command: ["/bin/sh", "-c"]
            args: ["$COMMAND"]
            resources:
              requests:
                cpu: "0.5"
                memory: 500Mi
              limits:
                cpu: "1"
                memory: 1000Mi
          restartPolicy: Never
          nodeSelector:
            agentpool: $AGENTPOOL
      backoffLimit: 2
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 2
