apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: credit-service
  name: credit-service
spec:
  replicas: 2
  selector:
    matchLabels:
      app: credit-service
  template:
    metadata:
        labels:
          app: credit-service
    spec:
      containers:
      - image: mfcobolbook/credit-service:1.0
        name: credit-service
        ports: 
        - containerPort: 8080 
        env:
        - name: POSTGRES_HOST
          valueFrom: 
             configMapKeyRef: 
                name: cs-connection-strings
                key: host
        - name: POSTGRES_DB
          valueFrom: 
             configMapKeyRef: 
                name: cs-connection-strings
                key: db-name
        - name: POSTGRES_USER
          valueFrom: 
             configMapKeyRef: 
                name: cs-connection-strings
                key: user
        - name: POSTGRES_PASSWORD
          valueFrom: 
             secretKeyRef: 
               name: pg-db-secrets
               key: password

          
 
