kind: CronJob
apiVersion: batch/v1beta1
metadata:
  name: tavros-spark-dependencies
  namespace: jaeger
  labels:
    app: jaeger
    app.kubernetes.io/component: spark-dependencies
    app.kubernetes.io/instance: tavros
    app.kubernetes.io/name: tavros-spark-dependencies
    app.kubernetes.io/part-of: jaeger
spec:
  schedule: 55 23 * * *
  concurrencyPolicy: Forbid
  suspend: false
  jobTemplate:
    spec:
      parallelism: 1
      template:
        metadata:
          labels:
            app: jaeger
            app.kubernetes.io/component: spark-dependencies
            app.kubernetes.io/instance: tavros
            app.kubernetes.io/name: tavros-spark-dependencies
            app.kubernetes.io/part-of: jaeger
          annotations:
            linkerd.io/inject: disabled
            prometheus.io/scrape: 'false'
            sidecar.istio.io/inject: 'false'
        spec:
          volumes:
            - name: certificates
              secret:
                secretName: es-http-certs
                defaultMode: 420
            - name: keystore-volume
              emptyDir: {}
          initContainers:
            - name: bootstrap-truststore
              image: 'openjdk:8-jre-slim'
              command: ['/bin/bash']
              args: ['-c', 'keytool -noprompt -import -trustcacerts -alias tls -file /es/certificates/tls.crt -keystore /var/run/secrets/java.io/keystores/truststore.jks -storepass password']
              volumeMounts:
                - name: certificates
                  readOnly: true
                  mountPath: /es/certificates/
                - name: keystore-volume
                  mountPath: /var/run/secrets/java.io/keystores
          containers:
            - name: tavros-spark-dependencies
              image: 'quay.io/jam01/jaeger-spark-dependencies:0.0.1-SNAPSHOT-001'
              envFrom:
                - secretRef:
                    name: jaeger-es-secret
              env:
                - name: STORAGE
                  value: elasticsearch
                - name: ES_NODES
                  value: 'https://tavros-es-http.elastic-system.svc:9200'
                - name: ES_INDEX_PREFIX
                  value: tavros
                - name: JAVA_OPTS
                  value: >-
                    -Djavax.net.ssl.trustStore=/var/run/secrets/java.io/keystores/truststore.jks
                    -Djavax.net.ssl.trustStorePassword=password
                - name: ES_TAGS_AS_FIELDS_ALL
                  value: 'true'
              resources:
                limits:
                  memory: 2Gi
                requests:
                  memory: 2Gi
              volumeMounts:
                - name: keystore-volume
                  mountPath: /var/run/secrets/java.io/keystores
          restartPolicy: Never
          terminationGracePeriodSeconds: 30
          dnsPolicy: ClusterFirst
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1