apiVersion: batch/v1
kind: Job
metadata:
  name: es-snapshot
  labels:
    component: es-snapshot
    version: v0.2.1
spec:
  template:
    metadata:
      labels:
        component: es-snapshot
        version: v0.2.1
    spec:
      containers:
      - name: es-snapshot
        image: quay.io/fsinvestments/es-snapshot:v0.2.1
        imagePullPolicy: IfNotPresent
        command: [ "/usr/bin/create-repository.sh" ]
        resources:
          requests:
            cpu: "50m"
            memory: "32Mi"
          limits:
            cpu: "100m"
            memory: "128Mi"
        env:
        - name: ES_SNAPSHOT_NAME
          value: "es-s3-backup"
        - name: ES_HOST
          value: localhost
        - name: ES_PORT
          value: "9200"
        volumeMounts:
        - name: es-snapshot-secret
          mountPath: /root/.aws
          readOnly: true
      volumes:
      - name: es-snapshot-secret
        secret:
          secretName: es-snapshot-secret
      restartPolicy: Never