From f4b903d9b85ce9849d134e8a32b9df89cbfb4ad9 Mon Sep 17 00:00:00 2001 From: liaozan <378024053@qq.com> Date: Sat, 16 Apr 2022 02:38:52 +0800 Subject: [PATCH] feat: add preStop probe to graceful shutdown --- k8s-deploy-template.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/k8s-deploy-template.yaml b/k8s-deploy-template.yaml index 4fb3d10..849b7aa 100644 --- a/k8s-deploy-template.yaml +++ b/k8s-deploy-template.yaml @@ -15,6 +15,7 @@ spec: labels: app: ${APP_NAME} spec: + terminationGracePeriodSeconds: 20 containers: - name: ${APP_NAME} image: ${IMAGE} @@ -24,6 +25,12 @@ spec: protocol: TCP - containerPort: 1024 protocol: TCP + lifecycle: + preStop: + httpGet: + scheme: HTTP + path: /actuator/offline + port: 1024 livenessProbe: httpGet: scheme: HTTP -- GitLab