aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh')
-rwxr-xr-xkubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh
new file mode 100755
index 0000000000..47c42d54ef
--- /dev/null
+++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-zookeeper-health.sh
@@ -0,0 +1,13 @@
+zkpod=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "message-router-zookeeper-[^[:space:]]*")
+if [ -n "$zkpod" ]; then
+ if /consul/bin/kubectl -n {{ .Values.nsPrefix }} exec -it $zkpod -- ps ef | grep -i zookeeper; then
+ echo Success. Zookeeper process is running. 2>&1
+ exit 0
+ else
+ echo Failed. Zookeeper is not running. 2>&1
+ exit 1
+ fi
+else
+ echo Failed. Zookeeper container is offline. 2>&1
+ exit 1
+fi