summaryrefslogtreecommitdiffstats
path: root/kubernetes/config/docker/init/src
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/config/docker/init/src')
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/mso-health.json28
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-api-script.sh15
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-camunda-script.sh15
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-jra-script.sh15
4 files changed, 73 insertions, 0 deletions
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mso-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mso-health.json
new file mode 100644
index 0000000000..354cd9ebab
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/mso-health.json
@@ -0,0 +1,28 @@
+{
+ "service": {
+ "name": "Health Check: MSO",
+ "checks": [
+ {
+ "id": "mso-api-healthcheck",
+ "name": "MSO API Health Check",
+ "script": "/consul/config/scripts/mso-api-script.sh",
+ "interval": "10s",
+ "timeout": "1s"
+ },
+ {
+ "id": "mso-camunda-healthcheck",
+ "name": "MSO Camunda Health Check",
+ "script": "/consul/config/scripts/mso-camunda-script.sh",
+ "interval": "10s",
+ "timeout": "1s"
+ },
+ {
+ "id": "mso-jra-healthcheck",
+ "name": "MSO JRA Health Check",
+ "script": "/consul/config/scripts/mso-jra-script.sh",
+ "interval": "10s",
+ "timeout": "1s"
+ }
+ ]
+ }
+}
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-api-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-api-script.sh
new file mode 100644
index 0000000000..ba0afc0dce
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-api-script.sh
@@ -0,0 +1,15 @@
+## Query the health check API.
+HEALTH_CHECK_ENDPOINT="http://mso.onap-mso.svc.cluster.local:8080/ecomp/mso/infra/healthcheck"
+HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT)
+
+READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready")
+
+if [ -n $READY ]; then
+ echo "Query against health check endpoint: $HEALTH_CHECK_ENDPOINT"
+ echo "Produces response: $HEALTH_CHECK_RESPONSE"
+ echo "Application is not in an available state"
+ return 2
+else
+ echo "Application is available."
+ return 0
+fi
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-camunda-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-camunda-script.sh
new file mode 100644
index 0000000000..254a0445ce
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-camunda-script.sh
@@ -0,0 +1,15 @@
+## Query the health check API.
+HEALTH_CHECK_ENDPOINT="http://mso.onap-mso.svc.cluster.local:8080/mso/healthcheck"
+HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT)
+
+READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready")
+
+if [ -n $READY ]; then
+ echo "Query against health check endpoint: $HEALTH_CHECK_ENDPOINT"
+ echo "Produces response: $HEALTH_CHECK_RESPONSE"
+ echo "Application is not in an available state"
+ return 2
+else
+ echo "Application is available."
+ return 0
+fi
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-jra-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-jra-script.sh
new file mode 100644
index 0000000000..29ffd8fe4c
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/mso-jra-script.sh
@@ -0,0 +1,15 @@
+## Query the health check API.
+HEALTH_CHECK_ENDPOINT="http://mso.onap-mso.svc.cluster.local:8080/networks/rest/healthcheck"
+HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT)
+
+READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready")
+
+if [ -n $READY ]; then
+ echo "Query against health check endpoint: $HEALTH_CHECK_ENDPOINT"
+ echo "Produces response: $HEALTH_CHECK_RESPONSE"
+ echo "Application is not in an available state"
+ return 2
+else
+ echo "Application is available."
+ return 0
+fi