summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis de Talhouƫt <alexis.de_talhouet@bell.ca>2017-09-22 17:20:10 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-22 17:20:10 +0000
commit83a6cf9f59fe4328ffe4b0f8e6cb5c80cee8e4b6 (patch)
tree7652e83af7c8dcfe8a3e9273ccffd3b4de27db28
parentde8d47e2497260fbe0530faf43eb51a074beef78 (diff)
parent16a74e7cfd6f0fd9165e164298a3127d3130bc63 (diff)
Merge "Add Consul health check support for message-router"
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-dmaap-health.json10
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-kafka-health.json10
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-zookeeper-health.json10
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-kafka-health.sh13
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-zookeeper-health.sh13
5 files changed, 56 insertions, 0 deletions
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-dmaap-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-dmaap-health.json
new file mode 100644
index 0000000000..bd01bc5d95
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-dmaap-health.json
@@ -0,0 +1,10 @@
+{
+ "service": {
+ "name": "Health Check: Message Router - DMaaP",
+ "check": {
+ "http": "http://dmaap.onap-message-router:3904/topics",
+ "interval": "30s",
+ "timeout": "1s"
+ }
+ }
+}
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-kafka-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-kafka-health.json
new file mode 100644
index 0000000000..128cf94460
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-kafka-health.json
@@ -0,0 +1,10 @@
+{
+ "service": {
+ "name": "Health Check: Message Router - Kafka",
+ "check": {
+ "script": "/consul/config/scripts/mr-kafka-health.sh",
+ "interval": "30s",
+ "timeout": "1s"
+ }
+ }
+}
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-zookeeper-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-zookeeper-health.json
new file mode 100644
index 0000000000..5268747349
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mr-zookeeper-health.json
@@ -0,0 +1,10 @@
+{
+ "service": {
+ "name": "Health Check: Message Router - ZooKeeper",
+ "check": {
+ "script": "/consul/config/scripts/mr-zookeeper-health.sh",
+ "interval": "30s",
+ "timeout": "1s"
+ }
+ }
+}
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
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-zookeeper-health.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-zookeeper-health.sh
new file mode 100644
index 0000000000..3da456c05a
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mr-zookeeper-health.sh
@@ -0,0 +1,13 @@
+zkpod=$(/consul/config/bin/kubectl -n onap-message-router get pod | grep -o "zookeeper-[^[:space:]]*")
+if [ -n "$zkpod" ]; then
+ if /consul/config/bin/kubectl -n onap-message-router 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