apiVersion: apps/v1
kind: Deployment
metadata:
  name: edge-service
  labels:
    app: edge-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: edge-service
  template:
    metadata:
      labels:
        app: edge-service
      annotations:
        prometheus.io/scrape : "true"
        prometheus.io/path : /actuator/prometheus
        prometheus.io/port : "9000"
    spec:
      containers:
        - name: edge-service
          image: edge-service
          imagePullPolicy: IfNotPresent
          lifecycle:
            preStop:
              exec:
                command: [ "sh", "-c", "sleep 5" ]
          ports:
            - containerPort: 9000
          livenessProbe:
            httpGet:
              path: /actuator/health/liveness
              port: 9000
            initialDelaySeconds: 10
            periodSeconds: 5
          readinessProbe:
            httpGet:
              path: /actuator/health/readiness
              port: 9000
            initialDelaySeconds: 5
            periodSeconds: 15
          env:
            - name: BOOK_SERVICE_URI
              value: http://book-service
            - name: SUGGESTION_SERVICE_URI
              value: http://suggestion-service
