apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: sending-mails
  namespace: aaas
spec:
  schedule: "3 * * * *"
  # schedule: "3 0,6,12,18  * * *"
  # schedule: "3 0,3,6,9,12,15,18,21  * * *"
  suspend: false
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: aaas-container
              image: atlasanalyticsservice/alarmandalertservice:latest
              imagePullPolicy: IfNotPresent
              command: ["/sending-mails.sh"]
              env:
                - name: MAILGUN_API_KEY
                  valueFrom:
                    secretKeyRef:
                      name: mailgun-secret
                      key: api-key
              volumeMounts:
                - name: config-volume
                  mountPath: "/config"
                  readOnly: true
          volumes:
            - name: config-volume
              secret:
                secretName: config
          restartPolicy: Never
