apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: snowalert
  labels:
    app: snowalert-ui
  annotations:
    monitoring: "true"
spec:
  schedule: "*/15 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - image: snowsec/snowalert:1.7.2-rc
            name: snowalert
            resources:
              limits:
                memory: "2Gi"
                cpu: "1000m"
              requests: 
                memory: "1Gi"
                cpu: "500m"
            env:
              - name: SA_ROLE
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: SA_ROLE
              - name: SA_DATABASE
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: SA_DATABASE
              - name: SA_WAREHOUSE
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: SA_WAREHOUSE
              - name: REGION
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: REGION
              - name: SNOWFLAKE_ACCOUNT
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: SNOWFLAKE_ACCOUNT
              - name: PRIVATE_KEY
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: PRIVATE_KEY
              - name: PRIVATE_KEY_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: PRIVATE_KEY_PASSWORD
              - name: JIRA_URL
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: JIRA_URL
              - name: JIRA_PROJECT
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: JIRA_PROJECT
              - name: JIRA_USER
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: JIRA_USER
              - name: JIRA_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: snowalert-secrets
                    key: JIRA_PASSWORD
          restartPolicy: Never