diff --git a/kafka/50kafka.yml b/kafka/50kafka.yml index 659c9d4d..376d063a 100644 --- a/kafka/50kafka.yml +++ b/kafka/50kafka.yml @@ -58,6 +58,10 @@ spec: command: - ./bin/kafka-server-start.sh - /etc/kafka/server.properties + lifecycle: + preStop: + exec: + command: ["sh", "-ce", "kill -s TERM 1; while $(kill -0 1 2>/dev/null); do sleep 1; done"] resources: requests: cpu: 100m diff --git a/zookeeper/50pzoo.yml b/zookeeper/50pzoo.yml index d923ee97..68e1dbdd 100644 --- a/zookeeper/50pzoo.yml +++ b/zookeeper/50pzoo.yml @@ -40,6 +40,10 @@ spec: command: - ./bin/zookeeper-server-start.sh - /etc/kafka/zookeeper.properties + lifecycle: + preStop: + exec: + command: ["sh", "-ce", "kill -s TERM 1; while $(kill -0 1 2>/dev/null); do sleep 1; done"] ports: - containerPort: 2181 name: client diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml index 88b781af..42c12128 100644 --- a/zookeeper/51zoo.yml +++ b/zookeeper/51zoo.yml @@ -43,6 +43,10 @@ spec: command: - ./bin/zookeeper-server-start.sh - /etc/kafka/zookeeper.properties + lifecycle: + preStop: + exec: + command: ["sh", "-ce", "kill -s TERM 1; while $(kill -0 1 2>/dev/null); do sleep 1; done"] ports: - containerPort: 2181 name: client