diff --git a/guestbook-go/check.sh b/guestbook-go/check.sh new file mode 100644 index 0000000..0b61f62 --- /dev/null +++ b/guestbook-go/check.sh @@ -0,0 +1,12 @@ +#!/bin/sh +#!/bin/sh +# +# Run this script with provider name as first argument +# + +if [ $1 == "kubernets" ]; then + IP=$(kubectl get service guestbook -o template --template="{{ .spec.clusterIP }}") + PORT=$(kubectl get service guestbook -o template --template="{{ (index .spec.ports 0).port }}") +fi + +curl --max-time 1 $IP:$PORT/info diff --git a/helloapache/check.sh b/helloapache/check.sh new file mode 100644 index 0000000..95fccf5 --- /dev/null +++ b/helloapache/check.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# Run this script with provider name as first argument +# + +if [ $1 == "kubernetes" ]; then + IP=$(kubectl get pod helloapache -o template --template="{{ .status.podIP }}") + PORT=$(kubectl get pod helloapache -o template --template="{{ (index (index .spec.containers 0).ports 0).containerPort }}") +fi + +if [ $1 == "docker" ]; then + IP=localhost + # TODO: get port from somewhere :-) + PORT=80 +fi + +curl --max-time 1 $IP:$PORT diff --git a/mariadb-centos7-atomicapp/check.sh b/mariadb-centos7-atomicapp/check.sh new file mode 100644 index 0000000..c27bf91 --- /dev/null +++ b/mariadb-centos7-atomicapp/check.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Run this script with provider name as first argument +# + +if [ $1 == "kubernetes" ]; then + IP=$(kubectl get service mariadb -o template --template="{{ .spec.clusterIP }}") + PORT=$(kubectl get service mariadb -o template --template="{{ (index .spec.ports 0).port }}") +fi + +if [ $1 == "docker" ]; then + IP=localhost + # TODO: get port from somewhere :-) + PORT=80 +fi + +# TODO: get them from answers.conf or as arguments to this script +db_pass="pass" +db_name="name" +db_user="user" + +docker run -it centos/mariadb mysqladmin -h $IP -P $PORT -u $db_user -p$db_pass --connect-timeout=10 ping diff --git a/mariadb-fedora-atomicapp/check.sh b/mariadb-fedora-atomicapp/check.sh new file mode 100644 index 0000000..c27bf91 --- /dev/null +++ b/mariadb-fedora-atomicapp/check.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Run this script with provider name as first argument +# + +if [ $1 == "kubernetes" ]; then + IP=$(kubectl get service mariadb -o template --template="{{ .spec.clusterIP }}") + PORT=$(kubectl get service mariadb -o template --template="{{ (index .spec.ports 0).port }}") +fi + +if [ $1 == "docker" ]; then + IP=localhost + # TODO: get port from somewhere :-) + PORT=80 +fi + +# TODO: get them from answers.conf or as arguments to this script +db_pass="pass" +db_name="name" +db_user="user" + +docker run -it centos/mariadb mysqladmin -h $IP -P $PORT -u $db_user -p$db_pass --connect-timeout=10 ping diff --git a/redis-centos7-atomicapp/check.sh b/redis-centos7-atomicapp/check.sh new file mode 100644 index 0000000..ed461e1 --- /dev/null +++ b/redis-centos7-atomicapp/check.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Run this script with provider name as first argument +# this script require netcat +# yum install netcat +# atp-get install netcat +# + +if [ $1 == "kubernetes" ]; then + IP=$(kubectl get service redis-master -o template --template="{{ .spec.clusterIP }}") + PORT=$(kubectl get service redis-master -o template --template="{{ (index .spec.ports 0).port }}") +fi + +if [ $1 == "docker" ]; then + IP=localhost + # TODO: get port from somewhere :-) + PORT=6379 +fi + + +(printf "PING\r\n"; sleep 0.5) | nc $IP $PORT | grep PONG diff --git a/skydns-atomicapp/check.sh b/skydns-atomicapp/check.sh new file mode 100644 index 0000000..4fc50e6 --- /dev/null +++ b/skydns-atomicapp/check.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# this scripts require nslookup +# yum install bind-utils +# apt-get install dnsutils +# + +IP=$(kubectl get service kube-dns -o template --template="{{ .spec.clusterIP }}") + +# TODO: get it from answers.conf or as arguments to this script +dns_domain="cluster.local" + +nslookup kubernetes.default.svc.$dns_domain $IP