mkdir my-postgres-chart
cd my-postgres-chart
helm create .
rm -rf templates/*
apiVersion: v2
name: my-postgres
description: A simple PostgreSQL Helm chart
version: 0.1.0
appVersion: "15" 
postgresUser: user
postgresPassword: password
postgresDatabase: mydb
namespace: postgres
image:
  repository: postgres
  tag: "15"
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.name }}
  namespace: {{ .Values.namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ .Values.name }}
  template:
    metadata:
      labels:
        app: {{ .Values.name }}
    spec:
      containers:
        - name: postgres
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          env:
            - name: POSTGRES_USER
              value: {{ .Values.postgresUser }}
            - name: POSTGRES_PASSWORD
              value: {{ .Values.postgresPassword }}
            - name: POSTGRES_DB
              value: {{ .Values.postgresDatabase }}
          ports:
            - containerPort: 5432
apiVersion: v1
kind: Namespace
metadata:
  name: {{ .Values.namespace }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "my-postgres.fullname" . }}
  namespace: {{ .Values.namespace }}
spec:
  selector:
    app: {{ include "my-postgres.name" . }}
  ports:
    - port: 5432
      targetPort: 5432

helm install postgres-chart . 
helm upgrade postgres-chart . 

Explore the pods and svc in the postgres namespace