apiVersion: batch/v1
kind: CronJob
metadata:
  name: itop-cron
  namespace: itop
spec:
  schedule: "*/1 * * * *"   # every minute (recommended by Combodo)
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 3
  jobTemplate:
    spec:
      backoffLimit: 1
      template:
        spec:
          restartPolicy: Never
          containers:
          - name: itop-cron
            image: vbkunin/itop:latest
            imagePullPolicy: IfNotPresent

            command:
              - php
              - /var/www/html/webservices/cron.php

            volumeMounts:
              - name: itop
                mountPath: /var/www/html/conf
                subPath: conf

          volumes:
            - name: itop
              persistentVolumeClaim:
                claimName: itop-pvc
