summaryrefslogtreecommitdiffstats
path: root/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh')
-rwxr-xr-xkubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh
new file mode 100755
index 0000000000..a109032d3b
--- /dev/null
+++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/mr-kafka-health.sh
@@ -0,0 +1,13 @@
+kafkapod=$(/consul/bin/kubectl -n {{ .Values.nsPrefix }} get pod | grep -o "message-router-global-kafka-[^[:space:]]*")
+if [ -n "$kafkapod" ]; then
+ if /consul/bin/kubectl -n {{ .Values.nsPrefix }} 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