apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: healthchecks-io
  namespace: posmon
spec:
  schedule: "*/1 * * * *"
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  startingDeadlineSeconds: 200
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: pinghc
            env:
            - name: HCURL
              valueFrom:
                secretKeyRef:
                  name: healthchecks-io
                  key: HCURL
            image: busybox
            args:
            - /bin/sh
            - -c
            - "date && echo $HCURL && /bin/wget -q -O - --no-check-certificate $HCURL"
          restartPolicy: OnFailure

