apiVersion: apps/v1 kind: Deployment metadata: namespace: test-env name: postgres-testbalance-testenv labels: app: postgres-testbalance-testenv spec: replicas: 1 selector: matchLabels: app: postgres-testbalance-testenv template: metadata: labels: app: postgres-testbalance-testenv spec: containers: - name: postgres-testbalance-testenv image: postgres:14.2 ports: - containerPort: 5432 env: - name: POSTGRES_DB valueFrom: secretKeyRef: name: pg-testbalance-testenv-secrets key: db - name: POSTGRES_USER valueFrom: secretKeyRef: name: pg-testbalance-testenv-secrets key: user - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: pg-testbalance-testenv-secrets key: password --- kind: Service apiVersion: v1 metadata: name: postgres-testbalance-testenv namespace: test-env spec: ports: - name: pgql-testbalance-testenv protocol: TCP port: 5432 targetPort: 5432 selector: app: postgres-testbalance-testenv