apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-deployment
  labels:
    app: api
    version: 1.0.0
spec:
  replicas: 1
  selector:
    matchLabels:
      component: api
  template:
    metadata:
      labels:
        component: api
        app: api
        version: 1.0.0
    spec:
      containers:
      - name: api
        image: edaddario/api
        ports:
        - containerPort: 5010
        env:
          - name: RABBITMQ_HOST
            value: rabbitmq-cluster-ip
          - name: RABBITMQ_PORT
            value: "5672"
          - name: RABBITMQ_USER
            value: guest
          - name: RABBITMQ_PASSWORD
            valueFrom:
              secretKeyRef:
                name: vault
                key: RABBITMQ_PASSWORD
          - name: REDIS_HOST
            value: redis-cluster-ip
          - name: REDIS_PORT
            value: "6379"
          - name: POSTGRES_USER
            value: postgres
          - name: POSTGRES_HOST
            value: postgres-cluster-ip
          - name: POSTGRES_PORT
            value: "5432"
          - name: POSTGRES_DATABASE
            value: postgres
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: vault
                key: POSTGRES_PASSWORD
        resources:
          limits:
            memory: "48Mi"
