# Copyright (c) 2021 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: ep-check-details
spec:
  schedule: "*/1 * * * *"
  startingDeadlineSeconds: 10 # if a job hasn't starting in this many seconds, skip
  concurrencyPolicy: Forbid # either allow|forbid|replace
  successfulJobsHistoryLimit: 3 # how many completed jobs should be
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app.kubernetes.io/created-by: healthcheck-controller
            kfip.sighup.io/group: BookInfo
            kfip.sighup.io/target: Details
            kfip.sighup.io/check: service-endpoints-check
        spec:
          serviceAccountName: fip-check-account
          containers:
          - name: ep-check-details
            image: registry.sighup.io/poc/service-endpoints-check:0.1.0
            imagePullPolicy: Always
            envFrom:
              - configMapRef:
                  name: ep-details-envs
          restartPolicy: OnFailure


