From 92079f8358ee70863e858af0692e7424f5d76510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20Garc=C3=ADa?= Date: Thu, 15 Feb 2018 05:06:42 +0100 Subject: [PATCH] Issue 7287 zookeeper testing probes (#7290) * Replace old zkOk.sh livenessProbe by zookeeper-ready Fixes one part of the issue #7287 * Update probe script content with the zookeeper-ready Fixes the part with shows/explains the probe script at issue #7287 * Fix the path to delete liveness probe Issue #7287 * Replace zkOk.sh readinessProbe by zookeeper-ready Fixes "Testing for Readiness" section in issue #7287 --- docs/tutorials/stateful-application/zookeeper.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/stateful-application/zookeeper.md b/docs/tutorials/stateful-application/zookeeper.md index 097d141d41..3796a3aeee 100644 --- a/docs/tutorials/stateful-application/zookeeper.md +++ b/docs/tutorials/stateful-application/zookeeper.md @@ -798,7 +798,9 @@ The Pod `template` for the `zk` StatefulSet specifies a liveness probe. livenessProbe: exec: command: - - "zkOk.sh" + - sh + - -c + - "zookeeper-ready 2181" initialDelaySeconds: 15 timeoutSeconds: 5 ``` @@ -809,8 +811,7 @@ word to test the server's health. ```bash -ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} -OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT) +OK=$(echo ruok | nc 127.0.0.1 $1) if [ "$OK" == "imok" ]; then exit 0 else @@ -831,7 +832,7 @@ In another window, delete the `zkOk.sh` script from the file system of Pod `zk-0 ```shell -kubectl exec zk-0 -- rm /opt/zookeeper/bin/zkOk.sh +kubectl exec zk-0 -- rm /usr/bin/zookeeper-ready ``` @@ -875,7 +876,9 @@ probe from the `zookeeper.yaml` manifest is identical to the liveness probe. readinessProbe: exec: command: - - "zkOk.sh" + - sh + - -c + - "zookeeper-ready 2181" initialDelaySeconds: 15 timeoutSeconds: 5 ```