apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
        - name: app
          image: localhost:32000/crimson_database:latest
          env:
            - name: POSTGRES_USER
              valueFrom:
                configMapKeyRef:
                  name: db-config
                  key: user
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: dbPassword
          imagePullPolicy: Always
          ports:
            - containerPort: 5432