apiVersion: apps/v1 kind: Deployment metadata: { name: postgres } spec: selector: { matchLabels: { app: postgres } } template: metadata: { labels: { app: postgres } } spec: containers: - name: postgres image: postgres:16-alpine env: - { name: POSTGRES_USER, value: rarelens } - { name: POSTGRES_PASSWORD, value: rarelens } - { name: POSTGRES_DB, value: rarelens } --- apiVersion: v1 kind: Service metadata: { name: postgres } spec: { selector: { app: postgres }, ports: [{ port: 5432 }] }