apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: todo-app
  name: todo-app
  namespace: default
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: todo-app
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: todo-app
    spec:
      containers:
        - name: be-todos
          image: be-todos
          imagePullPolicy: Always
          env:
            - name: spring.datasource.url
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: spring.datasource.url
            - name: spring.datasource.username
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: POSTGRES_USER
            - name: spring.datasource.password
              valueFrom:
                secretKeyRef:
                  name: todoapp-postgress-secret
                  key: POSTGRES_PASSWORD
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        - name: fe-todos
          image: fe-todos
          imagePullPolicy: Always
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30