Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Ensure cluster is in a green state before stopping a pod #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions es-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ spec:
ports:
- containerPort: 9300
name: transport
lifecycle:
preStop:
httpGet:
path: /_cluster/health?wait_for_status=green&timeout=28800s
port: 9300
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be port: 9200?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without terminationGracePeriodSeconds: 28800 the preStop command will be terminated after 30s even if it's still waiting for the elasticsearch api endpoint to timeout.

livenessProbe:
tcpSocket:
port: transport
Expand Down
5 changes: 5 additions & 0 deletions stateful/es-data-stateful.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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
Expand Down