aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/consul/resources/config/consul-agent-config/scripts
diff options
context:
space:
mode:
authorMike Elliott <mike.elliott@amdocs.com>2018-05-17 13:32:26 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-17 13:32:26 +0000
commita795258ebee5a9fa060aa89941503af2f11ae2d5 (patch)
tree69a7cf80792895beb8874ac1844aa04dfe9042f7 /kubernetes/consul/resources/config/consul-agent-config/scripts
parent888bb6bff8323657b4a84a7bf0bb544526e6712d (diff)
parentfa408712925a18a49614f1e4e295b49e1284cfd5 (diff)
Merge "Clamp DB Health Check"
Diffstat (limited to 'kubernetes/consul/resources/config/consul-agent-config/scripts')
-rw-r--r--kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh b/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh
new file mode 100644
index 0000000000..2cf7fc78c5
--- /dev/null
+++ b/kubernetes/consul/resources/config/consul-agent-config/scripts/clamp-mariadb-script.sh
@@ -0,0 +1,15 @@
+NAME=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "[^[:space:]]*-clampdb[^[:space:]]*")
+
+ if [ -n "$NAME" ]; then
+ if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then
+ echo Success. CLAMP DBHost is running. 2>&1
+ exit 0
+ else
+ echo Failed. CLAMP DBHost is not running. 2>&1
+ exit 1
+ fi
+ else
+ echo Failed. CLAMP DBHost is offline. 2>&1
+ exit 1
+ fi
+