apiVersion: v1
kind: ReplicationController
metadata:
  name: postgres-replication-controller
  labels:
    name: postgres
    context: DevOpsDemo
spec:
  replicas: 1
  selector:
    name: postgres
  template:
    metadata:
      labels:
        name: postgres
        context: DevOpsDemo
    spec:
      containers:
        - name: postgres
          image: postgres
          env:
            - name: POSTGRES_USER
              value: ticketmonster
            - name: POSTGRES_PASSWORD
              value: ticketmonster-docker
          ports:
            - name: postgres-port
              containerPort: 5432
              protocol: TCP
          volumeMounts:
            - name: pgdata
              mountPath: /var/lib/postgresql/data
      volumes:
        - name: pgdata

