apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: pd-elb-daily-slack
  namespace: metrics-tools
  labels:
    app.kubernetes.io/name: pd-elb-daily-slack
spec:
  schedule: "0 17 * * *"
  startingDeadlineSeconds: 10
  concurrencyPolicy: Forbid
  jobTemplate:
    metadata:
      labels:
        app.kubernetes.io/name: pd-elb-daily-slack
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
          - name: pd-elb-daily-slack
            image: "docker-registry.zooxlabs.com/sli_kron_base:3"
            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 --daily --es_url https://search-metrics-production-c65mdhdibmbmkl4pfiqsj5yhmq.us-west-2.es.amazonaws.com:443 --pd_elb_metrics --kraken_metrics --no_index --notify_slack"]
            imagePullPolicy: IfNotPresent
