---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mirror-spack-io-redirect
  namespace: spack
  labels:
    app: mirror-spack-io
    svc: web-redirect
spec:
  selector:
    matchLabels:
      app: mirror-spack-io
      svc: web-redirect
  replicas: 2
  template:
    metadata:
      labels:
        app: mirror-spack-io
        svc: web-redirect
    spec:
      containers:
      - name: web
        image: "opadron/s3-tree-proxy"
        imagePullPolicy: Always
        env:
        - name: MOUNT_PATH
          value: "/mirror"
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: spack-aws-credentials
              key: aws_access_key_id
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: spack-aws-credentials
              key: aws_secret_access_key
        ports:
        - name: http
          containerPort: 8080
      nodeSelector:
        "beta.kubernetes.io/instance-type": "t2.medium"
