apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
spec:
  selector:
    matchLabels:
      app: app
  template:
    metadata:
      labels:
        app: app
      annotations:
        # enable collecting log when pod is unready
        ad.datadoghq.com/tolerate-unready: "true"
    spec:
      terminationGracePeriodSeconds: 300
      containers:
        - name: app
          image: guitarrapc/grpcservice-test:0.1.6
          lifecycle:
            preStop:
              exec:
                command: ["sh", "-c", "sleep 5"]
          resources:
            limits:
              memory: "128Mi"
              cpu: "500m"
          ports:
            - containerPort: 80
              name: grpc
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=127.0.0.1:80"]
            initialDelaySeconds: 10
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=127.0.0.1:80"]
            initialDelaySeconds: 10
