---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: todos-api
  namespace: team16
  labels:
    app: todos-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: todos-api
  template:
    metadata:
      labels:
        app: todos-api
    spec:
      containers:
      - env:
        - name: TODO_API_PORT
          valueFrom:
            configMapKeyRef:
              name: todos-api
              key: TODO_API_PORT
        - name: REDIS_HOST
          valueFrom:
            configMapKeyRef:
              name: todos-api
              key: REDIS_HOST
        - name: REDIS_PORT
          valueFrom:
            configMapKeyRef:
              name: todos-api
              key: REDIS_PORT
        - name: REDIS_CHANNEL
          valueFrom:
            configMapKeyRef:
              name: todos-api
              key: REDIS_CHANNEL
        - name: JWT_SECRET
          valueFrom:
            secretKeyRef:
              name: todos-api
              key: JWT_SECRET
        name: todos-api
        image: 561341012850.dkr.ecr.us-east-1.amazonaws.com/team16-todos-api
        imagePullPolicy: Always
        ports:
        - containerPort: 8082
      restartPolicy: Always
        