apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: letterbox
  name: letterbox
  namespace: letterbox
spec:
  replicas: 4
  selector:
    matchLabels:
      app: letterbox
  template:
    metadata:
      labels:
        app: letterbox
      namespace: letterbox
    spec:
      containers:
      - image: elementbound/letterbox
        name: letterbox
        ports:
          - containerPort: 3000
        envFrom:
        - configMapRef:
            name: letterbox-config
        env:
        - name: DATABASE_USER
          valueFrom:
            secretKeyRef:
              name: letterbox-db-root
              key: DATABASE_USER
        - name: DATABASE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: letterbox-db-root
              key: DATABASE_PASSWORD
        - name: MQ_ADDRESS
          valueFrom:
            secretKeyRef:
              name: letterbox-mq-secret
              key: url
