---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: comments-app
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      name: comments-app
  template:
    metadata:
      labels:
        name: comments-app
    spec:
      containers:
      - name: application
        image: "hasanshahjahan/comments-api:latest"
        imagePullPolicy: Always
        ports:
          - containerPort: 8080
        env:
          - name: DB_PORT
            value: "5432"
          - name: DB_HOST
            value: "localhost"
          - name: DB_PASSWORD
            value: "postgres"
          - name: DB_TABLE
            value: "postgres"
          - name: DB_USERNAME
            value: "postgres"