Merge pull request #49618 from pavolloffay/cassandra-preStop-drain

Automatic merge from submit-queue (batch tested with PRs 47724, 49984, 49785, 49803, 49618)

Cassandra example, use nodetool drain in preStop

Related to https://github.com/kubernetes/kubernetes/pull/39199#discussion_r129506191
pull/6/head
Kubernetes Submit Queue 2017-08-11 18:47:24 -07:00 committed by GitHub
commit bb67819ed1
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ spec:
labels:
app: cassandra
spec:
terminationGracePeriodSeconds: 1800
containers:
- name: cassandra
image: gcr.io/google-samples/cassandra:v12
@ -37,7 +38,7 @@ spec:
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
command: ["/bin/sh", "-c", "nodetool drain"]
env:
- name: MAX_HEAP_SIZE
value: 512M