apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgres
spec:
  replicas: 1
  revisionHistoryLimit: 2
  serviceName: postgres
  template:
    spec:
      containers:
      - name: postgres
        image: ${DOCKER_REGISTRY}/openshift/postgresql:9.6
        imagePullPolicy: Always
        ports:
        - name: postgres
          containerPort: 5432
        envFrom:
        - secretRef:
            name: postgres
        livenessProbe:
          tcpSocket:
            port: postgres
          initialDelaySeconds: 30
        readinessProbe:
          exec:
            command:
            - /bin/sh
            - -i
            - -c
            - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c
              'SELECT 1'
          initialDelaySeconds: 8
        resources:
          requests:
            cpu: 500m
            memory: 512Mi
          limits:
            cpu: 1000m
            memory: 1Gi
        volumeMounts:
        - name: data
          mountPath: /var/lib/pgsql/data
      restartPolicy: Always
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: postgres
spec:
  replicas: 1
  revisionHistoryLimit: 2
  serviceName: postgres
  template:
    spec:
      containers:
      - name: postgres
        image: docker-registry.default.svc:5000/openshift/postgresql:9.6
        imagePullPolicy: Always
        ports:
        - name: postgres
          containerPort: 5432
        envFrom:
        - secretRef:
            name: postgres
        livenessProbe:
          tcpSocket:
            port: postgres
          initialDelaySeconds: 30
        readinessProbe:
          exec:
            command:
            - /bin/sh
            - -i
            - -c
            - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c
              'SELECT 1'
          initialDelaySeconds: 8
        resources:
          requests:
            cpu: 500m
            memory: 512Mi
          limits:
            cpu: 1000m
            memory: 1Gi
        volumeMounts:
        - name: data
          mountPath: /var/lib/pgsql/data
      restartPolicy: Always
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 1Gi

Use default registry again for database image
Use default registry again for database image
