apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: pd-canary-sli-hourly
  namespace: metrics-tools
  labels:
    app.kubernetes.io/name: pd-canary-sli-hourly
spec:
  schedule: "*/10 * * * *"
  startingDeadlineSeconds: 10
  concurrencyPolicy: Forbid
  jobTemplate:
    metadata:
      labels:
        app.kubernetes.io/name: pd-canary-sli-hourly
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
          - name: pd-canary-sli-hourly
            image: "docker-registry.zooxlabs.com/pipedream-canary-sli-hourly:1"
            env:
              - name: AWS_ACCESS_KEY_ID
                valueFrom:
                  secretKeyRef:
                    name: mwurtz-aws-ro-creds
                    key: aws_access_key_id
              - name: AWS_SECRET_ACCESS_KEY
                valueFrom:
                  secretKeyRef:
                    name: mwurtz-aws-ro-creds
                    key: aws_secret_access_key
              - name: SLACK_WEBHOOK_URL
                valueFrom:
                  secretKeyRef:
                    name: slack-webhook-sre
                    key: webhook_url
              - name: AWS_DEFAULT_REGION
                value: us-west-1
            workingDir: /opt/zoox
            command: ["bash"]
            args: ["-c", "python3 get_pd_elk_metrics.py --weekly --pd_canary_metrics --es_url https://search-metrics-production-c65mdhdibmbmkl4pfiqsj5yhmq.us-west-2.es.amazonaws.com:443"]
            imagePullPolicy: Always
