apiVersion: v1
kind: Pod
metadata:
  name: {{ template "cloudserver.fullname" . }}-test
  annotations:
    "helm.sh/hook": test-success
spec:
  containers:
  - name: {{ template "cloudserver.fullname" . }}-test
    imagePullPolicy: IfNotPresent
    image: "docker.io/mesosphere/aws-cli:1.14.5"
    command:
      - sh
      - -c
      - aws s3 --endpoint-url=http://{{ include "cloudserver.fullname" . }} --region=us-east-1 ls
    env:
      - name: AWS_ACCESS_KEY_ID
        valueFrom:
          secretKeyRef:
            name: {{ template "cloudserver.fullname" . }}
            key: accessKey
      - name: AWS_SECRET_ACCESS_KEY
        valueFrom:
          secretKeyRef:
            name: {{ template "cloudserver.fullname" . }}
            key: secretKey
  restartPolicy: Never
