From 1ef61f3d901724a8c3c3920a703f0bad6e20488b Mon Sep 17 00:00:00 2001 From: Deimosfr Date: Tue, 19 Sep 2017 20:55:20 +0200 Subject: [PATCH] Ensure cluster is in a green state before stopping a pod The timeout is set to 8h before releasing the hook and forcing ES node to shutdown. --- es-data.yaml | 5 +++++ stateful/es-data-stateful.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/es-data.yaml b/es-data.yaml index c41d5a3..fc78c31 100644 --- a/es-data.yaml +++ b/es-data.yaml @@ -53,6 +53,11 @@ spec: - containerPort: 9300 name: transport protocol: TCP + lifecycle: + preStop: + httpGet: + path: /_cluster/health?wait_for_status=green&timeout=28800s + port: 9300 volumeMounts: - name: storage mountPath: /data diff --git a/stateful/es-data-stateful.yaml b/stateful/es-data-stateful.yaml index fccc218..6216719 100644 --- a/stateful/es-data-stateful.yaml +++ b/stateful/es-data-stateful.yaml @@ -49,6 +49,11 @@ spec: value: "false" - name: "ES_JAVA_OPTS" value: "-Xms256m -Xmx256m" + lifecycle: + preStop: + httpGet: + path: /_cluster/health?wait_for_status=green&timeout=28800s + port: 9300 ports: - containerPort: 9300 name: transport