summaryrefslogtreecommitdiffstats
path: root/kubernetes/config
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/config')
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh14
-rw-r--r--kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json29
2 files changed, 43 insertions, 0 deletions
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh
new file mode 100644
index 0000000000..c87686f764
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/scripts/vid-mariadb-script.sh
@@ -0,0 +1,14 @@
+NAME=$(/consul/config/bin/kubectl -n onap-vid get pod | grep -o "vid-mariadb[^[:space:]]*")
+
+ if [ -n "$NAME" ]; then
+ if /consul/config/bin/kubectl -n onap-vid exec -it $NAME -- bash -c 'mysqladmin status -u root -p$MYSQL_ROOT_PASSWORD' > /dev/null; then
+ echo Success. mariadb process is running. 2>&1
+ exit 0
+ else
+ echo Failed. mariadb process is not running. 2>&1
+ exit 1
+ fi
+ else
+ echo Failed. mariadb container is offline. 2>&1
+ exit 1
+ fi
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json
new file mode 100644
index 0000000000..8a2a4dca9b
--- /dev/null
+++ b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/vid-health.json
@@ -0,0 +1,29 @@
+{
+ "service": {
+ "name": "Health Check: VID",
+ "checks": [
+ {
+ "id": "vid-server",
+ "name": "VID Server Health Check",
+ "http": "http://vid-server.onap-vid:8080/vid/healthCheck",
+ "method": "GET",
+ "header": {
+ "Authorization": ["Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="],
+ "Cache-Control": ["no-cache"],
+ "Content-Type": ["application/json"],
+ "Accept": ["application/json"]
+ },
+ "tls_skip_verify": true,
+ "interval": "15s",
+ "timeout": "1s"
+ },
+ {
+ "id": "vid-mariadb",
+ "name": "Vid Mariadb Health Check",
+ "script": "/consul/config/scripts/vid-mariadb-script.sh",
+ "interval": "10s",
+ "timeout": "1s"
+ }
+ ]
+ }
+}