apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: hello-world-service
  name: hello-world-service
  labels:
    app: hello-world-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-world-service
  template:
    metadata:
      labels:
        app: hello-world-service
    spec:
      containers:
      - image: spring-k8s-prometheus:0.0.1-SNAPSHOT
        name: hello-world-service
        lifecycle:
          preStop:
            exec:
              command: [ "sh", "-c", "sleep 10" ]
        ports:
          - containerPort: 8080
            name: http
            protocol: TCP
        livenessProbe:
          httpGet:
            path: /actuator/health/liveness
            port: 8080
          initialDelaySeconds: 300
          timeoutSeconds: 20
        readinessProbe:
          httpGet:
            path: /actuator/health/readiness
            port: 8080
