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 1 commit
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 @@ -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
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.

volumeMounts:
- name: storage
mountPath: /data
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 @@ -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
Expand Down