apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres-deployment
  # * Create namespace before use this Deployment 
  namespace: ns-gitea
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels: 
        app: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 5432
          envFrom:
            - configMapRef: 
                name: postgres-configmap
          volumeMounts: 
            - mountPath: /var/lib/postgresql/data
              name: postgresdb
      volumes:
        - name: postgresdb
          persistentVolumeClaim: 
            claimName: postgres-pv-claim
