apiVersion: v1
kind: ReplicationController
metadata:
  name: postgre4
spec:
  replicas: 1
  selector:
    name: postgre
    sonar-version: v4
  template:
    metadata:
      labels:
        name: postgre
        sonar-version: v4
    spec:
      containers:
      - image: orchardup/postgresql:latest
        name: postgre
        env:
          - name: POSTGRESQL_USER
            value: sonar
          - name: POSTGRESQL_PASS
            value: xaexohquaetiesoo
          - name: POSTGRESQL_DB
            value: sonar
        ports:
        - name: postgre4
          containerPort: 5432
          hostPort: 5432
        volumeMounts:
            - name: postgre-sonar4-storage
              mountPath: /var/lib/postgresql
      volumes:
        - name: postgre-sonar4-storage
          hostPath:
            path: /var/data/docker/postgre-sonar4
