apiVersion: batch/v1
kind: Job
metadata:
  name: o11y-agent-finalizer
spec:
  backoffLimit: 0
  ttlSecondsAfterFinished: 3600 # cleanup pod after 1 hour
  template:
    spec:
      containers:
        - name: deployer
          image: deploy-job-runner:18898806413
          command:
            - /deploy.sh
            - azure-region-control/finalizers/o11y-agent
          volumeMounts:
            - name: credentials
              mountPath: /root/.azure
      initContainers:
        - name: copy-credentials
          command:
            - bash
            - -c
            - cp ~/.azure/* /mnt/azure-credentials/
          image: deploy-job-runner:18898806413
          volumeMounts:
            # ~/.azure is mounted by deploy cli
            - name: credentials
              mountPath: /mnt/azure-credentials
      volumes:
        - name: credentials
          emptyDir: {}
      restartPolicy: Never
      serviceAccountName: deploy-job-runner
