---
apiVersion: batch/v1
kind: Job
metadata:
  name: trews-session-loader
spec:
  template:
    metadata:
      name: trews-session-loader
      namespace: default
    spec:
      restartPolicy: Never
      nodeSelector:
        opsdx_nodegroup: spot-nodes
      containers:
      - name: universe
        image: 359300513585.dkr.ecr.us-east-1.amazonaws.com/universe:1.0.454
        imagePullPolicy: IfNotPresent
        command:
          - sh
          - -c
          - "/usr/local/bin/python3 /jobs/dev/session-loader/session_loader.py 10"
        env:
        - name: epic_server
          value: "test"
        - name: db_host
          value: "dev.db.jh.opsdx.io"
        - name: db_port
          value: "5432"
        - name: db_name
          #value: "opsdx_dev"
          value: "opsdx_test"
        - name: db_user
          valueFrom:
            secretKeyRef:
              name: rest-api-db-secrets
              key: db-username
        - name: db_password
          valueFrom:
            secretKeyRef:
              name: rest-api-db-secrets
              key: db-password
        - name: jhapi_client_id
          valueFrom:
            secretKeyRef:
              name: rest-api-db-secrets
              key: jhapi-client-id
        - name: jhapi_client_secret
          valueFrom:
            secretKeyRef:
              name: rest-api-db-secrets
              key: jhapi-client-secret
        - name: AWS_DEFAULT_REGION
          valueFrom:
            secretKeyRef:
              name: dw-s3-export-secrets
              key: aws-region
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: dw-s3-export-secrets
              key: aws-access-key-id
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: dw-s3-export-secrets
              key: aws-secret-access-key
        securityContext:
          privileged: true
