summaryrefslogtreecommitdiffstats
path: root/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh')
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh
new file mode 100644
index 0000000000..317c2a699c
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh
@@ -0,0 +1,13 @@
+kafkapod=$(/consul/config/bin/kubectl -n onap-message-router get pod | grep -o "global-kafka-[^[:space:]]*")
+if [ -n "$kafkapod" ]; then
+ if /consul/config/bin/kubectl -n onap-message-router exec -it $kafkapod -- ps ef | grep -i kafka; then
+ echo Success. Kafka process is running. 2>&1
+ exit 0
+ else
+ echo Failed. Kafka is not running. 2>&1
+ exit 1
+ fi
+else
+ echo Failed. Kafka container is offline. 2>&1
+ exit 1
+fi