apiVersion: apps/v1
kind: Deployment
metadata:
  name: order-app
  labels:
    app: order-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: order-app
  template:
    metadata:
      labels:
        app: order-app
    spec:
      terminationGracePeriodSeconds: 20
      containers:
        - name: catalog-app
          image: polarbookshop/order-service:0.0.1-SNAPSHOT
          lifecycle:
            preStop:
              exec:
                command: [ "sh", "-c", "sleep 5" ]
          ports:
            - containerPort: 9002
          env:
            - name: SPRING_DATASOURCE_URL
              value: r2dbc:postgresql://polardb-order-postgresql:5432/polardb_order
          resources:
            requests:
              memory: "512Mi"
              cpu: "0.5"
            limits:
              memory: "512Mi"
