apiVersion: batch/v1
kind: Job
metadata:
  name: "{{ .Release.Name }}-job"
  namespace: "{{ .Values.namespace }}"
  labels:
    type: 'pipeline'
    experimentId: "{{ .Values.experimentId }}"
    sandboxId: "{{ .Values.sandboxId }}"
spec:
  template:
    metadata:
      name: "{{ .Release.Name }}-server"
      labels:
        type: 'pipeline'
        experimentId: "{{ .Values.experimentId }}"
        sandboxId: "{{ .Values.sandboxId }}"
    spec:
      restartPolicy: Never
      serviceAccountName: 'deployment-runner'
      containers:
      - name: "{{ .Release.Name }}"
        image: "{{ .Values.image }}"
        env:
          - name: CLUSTER_ENV
            value: "{{ .Values.clusterEnv }}"
          - name: SANDBOX_ID
            value: "{{ .Values.sandboxId }}"
          - name: AWS_ACCOUNT_ID
            value: "{{ .Values.awsAccountId }}"
          - name: AWS_DEFAULT_REGION
            value: "{{ .Values.awsRegion }}"
          - name: ACTIVITY_ARN
            value: "{{ .Values.activityArn }}"
