apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
  namespace: homolog
spec:
  replicas: 2
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
      - name: api
        image: fabricioveronez/pedelogo-catalogo:v1.0.0
        resources:
          limits:
            memory: "256Mi"
            cpu: "200m"
        ports:
        - containerPort: 80
        imagePullPolicy: IfNotPresent
        envFrom:
            - configMapRef:
                  name: api-configmap

        env:
        - name: Mongo__User
          valueFrom:
            configMapKeyRef:
                key: MONGO_INITDB_ROOT_USERNAME
                name: mongodb-configmap

        - name: Mongo__Password
          valueFrom:
                configMapKeyRef:
                    key: MONGO_INITDB_ROOT_PASSWORD
                    name: mongodb-configmap

        
        #env:
        #- name: Mongo__Host
        #  value: "mongodb.mongodb.svc.cluster.local"
        #- name: Mongo__User
        #  value: "mongouser"
        #- name: Mongo_Password
        #  value: "mongopwd"
        #- name: Mongo__Port
        #  value: "27017"
        #- name: Mongo_DataBase
        #  value: "admin"