apiVersion: apps/v1
kind: Deployment
metadata:
  name: uploads-service-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: uploads-service
  template:
    metadata:
      labels:
        app: uploads-service
    spec:
      imagePullSecrets:
      - name: registry-credentials
      containers:
        - name: uploads-service
          image: stokei/uploads-service:latest
          resources: {}
          imagePullPolicy: Always
          env:
            - name: DB_NAME
              value: "uploads"
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-host
            - name: DB_PORT
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-port
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-user
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-password
            - name: DB_OPTIONS
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-options
            - name: DB_PREFIX
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-prefix
            - name: DB_TIMEOUT
              valueFrom:
                secretKeyRef:
                  name: mongodb-secret
                  key: db-timeout
            - name: QUEUE_HOST
              valueFrom:
                secretKeyRef:
                  name: redis-secret
                  key: queue-host
            - name: QUEUE_PORT
              valueFrom:
                secretKeyRef:
                  name: redis-secret
                  key: queue-port
            - name: QUEUE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: redis-secret
                  key: queue-password
            - name: QUEUE_TIMEOUT
              valueFrom:
                secretKeyRef:
                  name: redis-secret
                  key: queue-timeout
            - name: AWS_BUCKET
              valueFrom:
                secretKeyRef:
                  name: aws-secret
                  key: access-bucket
            - name: AWS_ENDPOINT
              valueFrom:
                secretKeyRef:
                  name: aws-secret
                  key: access-endpoint
            - name: AWS_ACCESS_ID
              valueFrom:
                secretKeyRef:
                  name: aws-secret
                  key: access-id
            - name: AWS_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: aws-secret
                  key: access-secret
            - name: ASSETS_URL
              valueFrom:
                configMapKeyRef:
                  name: urls-configmap
                  key: assets-url
            - name: PATH_IMAGES
              valueFrom:
                secretKeyRef:
                  name: uploads-secret
                  key: path-images
            - name: PATH_VIDEOS
              valueFrom:
                secretKeyRef:
                  name: uploads-secret
                  key: path-videos
            - name: PATH_FILES
              valueFrom:
                secretKeyRef:
                  name: uploads-secret
                  key: path-files
            - name: VIDEO_ENCODER_KEY
              valueFrom:
                secretKeyRef:
                  name: uploads-secret
                  key: video-encoder-key
            - name: VIDEO_ENCODER_ENDPOINT
              valueFrom:
                secretKeyRef:
                  name: uploads-secret
                  key: video-encoder-endpoint
            - name: VIDEO_ENCODER_CALLBACK_URL
              valueFrom:
                configMapKeyRef:
                  name: urls-configmap
                  key: videos-notification-url
            - name: MICROSERVICE_URL
              valueFrom:
                secretKeyRef:
                  name: rabbitmq-secret
                  key: url
