postgresql-pod.yaml 1.2 KB
---
apiVersion: v1
kind: Service
metadata:
  name: postgresql-server-
  ownerReferences:
    - apiVersion: v1
      kind: Pod
      blockOwnerDeletion: true
      controller: true
      name: PARENT_POD_NAME
      uid: PARENT_POD_UID
spec:
  type: ClusterIP
  selector:
    owner-uid: PARENT_POD_UID
  ports:
    - name: pgsql
      protocol: TCP
      port: 5432
      targetPort: 5432
---
apiVersion: v1
kind: Pod
metadata:
  name: postgresql-server-
  labels:
    owner-uid: PARENT_POD_UID
  ownerReferences:
    - apiVersion: v1
      kind: Pod
      blockOwnerDeletion: true
      controller: true
      name: PARENT_POD_NAME
      uid: PARENT_POD_UID
spec:
  volumes:
    - name: postgresql-data
      emptyDir: {}
    - name: postgresql-confd
      configMap:
        name: task-postgresql-confd
  containers:
    - name: postgresql
      image: bitnami/postgresql:14.1.0-debian-10-r66
      #securityContext:
      #  runAsUser: 1001
      #  runAsGroup: 1001
      env:
        - name: POSTGRESQL_PASSWORD
          value: CHANGEME

      volumeMounts:
        - name: postgresql-data
          mountPath: /bitnami/postgresql

        - name: postgresql-confd
          mountPath: /opt/bitnami/postgresql/conf/conf.d
---