apiVersion: batch/v1
kind: Job
metadata:
  name: trireme-grafana-init
  namespace: kube-system
spec:
  template:
    metadata:
      name: trireme-grafana-init
    spec:
      containers:
      - name: trireme-grafana-init
        image: aporeto/trireme-grafanainit:latest
        env:
             - name: TRIREME_LOGLEVEL
               valueFrom:
                 configMapKeyRef:
                   key: trireme.log_level
                   name: trireme-config
                   optional: true
             - name: TRIREME_INFLUXURL
               valueFrom:
                 configMapKeyRef:
                   key: trireme.collector_endpoint
                   name: trireme-config
                   optional: true
             - name: TRIREME_INFLUXUSERNAME
               valueFrom:
                 configMapKeyRef:
                   key: trireme.collector_user
                   name: trireme-config
                   optional: true
             - name: TRIREME_INFLUXPASSWORD
               valueFrom:
                 configMapKeyRef:
                   key: trireme.collector_password
                   name: trireme-config
                   optional: true
             - name: TRIREME_INFLUXDBNAME
               valueFrom:
                 configMapKeyRef:
                   key: trireme.collector_db
                   name: trireme-config
                   optional: true
             - name: TRIREME_DBSKIPTLS
               valueFrom:
                 configMapKeyRef:
                   key: trireme.collector_insecure_skip_verify
                   name: trireme-config
                   optional: true
             - name: TRIREME_GRAFANAURL
               valueFrom:
                 configMapKeyRef:
                   key: trireme.grafana_endpoint
                   name: trireme-config
                   optional: true
             - name: TRIREME_GRAFANAUSERNAME
               valueFrom:
                 configMapKeyRef:
                   key: trireme.grafana_user
                   name: trireme-config
                   optional: true
             - name: TRIREME_GRAFANAPASSWORD
               valueFrom:
                 configMapKeyRef:
                   key: trireme.grafana_password
                   name: trireme-config
                   optional: true
             - name: TRIREME_GRAFANADBACCESS
               valueFrom:
                 configMapKeyRef:
                   key: trireme.grafana_access_type
                   name: trireme-config
                   optional: true
      restartPolicy: Never