apiVersion: apps/v1
kind: Deployment
metadata:
  name: project-svc-dep
  namespace: project-namespace
spec:
  replicas: 1
  selector:
    matchLabels:
      app: project-svc
  template:
    metadata:
      labels:
        app: project-svc
    spec:
      volumes:
        - name: img-data
          persistentVolumeClaim:
            claimName: local-claim
      containers:
        - name: service-container
          image: robsondepaula/project-service:2_10
          envFrom:
            - secretRef:
                name: db-password
          env:
            - name: IMG_STORAGE
              value: /data/images/
            - name: SVC_PORT
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: SVC_PORT
            - name: POSTGRES_HOST
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: POSTGRES_HOST
            - name: POSTGRES_PORT
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: POSTGRES_PORT
            - name: POSTGRES_USER
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: POSTGRES_USER
            - name: POSTGRES_DB
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: POSTGRES_DB
            - name: POSTGRES_TABLE
              valueFrom:
                configMapKeyRef:
                  name: project-svc-config
                  key: POSTGRES_TABLE
          volumeMounts:
            - name: img-data
              mountPath: /data
