apiVersion: v1
kind: ReplicationController
metadata:
  name: postgres-hue
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: postgres-hue
    spec:
      containers:
        - name: postgres-hue
          image: postgres:9.5
          env:
            - name: POSTGRES_USER
              value: hue
            - name: POSTGRES_PASSWORD
              value: hue
            - name: POSTGRES_DB
              value: hue
            - name: PGDATA
              value: /var/lib/postgresql/data/pgdata
            #   valueFrom:
            #     secretKeyRef:
            #       name: postgres-credentials
            #       key: user

            # - name: POSTGRES_PASSWORD
            #   valueFrom:
            #     secretKeyRef:
            #       name: postgres-credentials
            #       key: password
          ports:
            - containerPort: 5432
          volumeMounts:
            - name: postgres-data
              mountPath: /var/lib/postgresql/data
      volumes:
        - name: postgres-data
          persistentVolumeClaim:
            claimName: postgres-pvc
