apiVersion: batch/v1
kind: Job
metadata:
  name: latency-job
  namespace: lightning
spec:
  backoffLimit: 1
  template:
    spec:
      restartPolicy: Never
      volumes:
        - name: service-account
          secret:
            secretName: storage-credentials
      containers:
      - name: storage-writer
        image: gcr.io/schnauzer-163208/osb-demo
        imagePullPolicy: Always
        resources:
          limits:
            cpu: "100m"
            memory: "64Mi"
        volumeMounts:
          - name: service-account
            mountPath: /var/secrets/service-account
        env:
          - name: GOOGLE_APPLICATION_CREDENTIALS
            value: /var/secrets/service-account/privateKeyData
          - name: STORAGE_PROJECT
            valueFrom:
              secretKeyRef:
                name: storage-binding
                key: projectId
          - name: STORAGE_BUCKET
            valueFrom:
              secretKeyRef:
                name: storage-binding
                key: bucketId
