apiVersion: apps/v1
kind: Deployment
metadata:
  name: db-deployment
  labels:
    name: db
    app: example-voting-app
spec:
  replicas: 1
  template:
    metadata:
      name: db
      labels:
        name: db
        app: example-voting-app
    spec:
      containers:
        - name: postgres
          image: postgres
          ports:
            - containerPort: 5432
          env:
            - name: POSTGRES_USER
              value: "postgres"
            - name: POSTGRES_PASSWORD
              value: "postgres"
            - name: POSTGRES_HOST_AUTH_METHOD
              value: trust
  selector:
    matchLabels:
      name: db
      app: example-voting-app

