         sleep $interval
         duration=$((duration + interval))
 
-        kubectl exec $1 -- echo 'i am alive' >/tmp/response.log 2>&1
-        declare response_code=$(tail -1 /tmp/response.log)
+        declare response_code=$(kubectl get pods --namespace service-dev -o jsonpath="{.items[0].status.phase}")
       done
 
-      echo ' succeeded!'
+      echo 'pod is in the ready state'
     }
 
     function switch_client_version () {

      if [ "$param" == "start" ]; then
        # Dependency on a hypervisor will be dropped off in the future
        command -v docker           >/dev/null 2>&1 || { echo >&2 "I require docker but it's not installed.  Aborting."; exit 1; }
        command -v VirtualBox       >/dev/null 2>&1 || { echo >&2 "I require VirtualBox but it's not installed.  Aborting."; exit 1; }
        command -v minikube         >/dev/null 2>&1 || { echo >&2 "I require a Kubernetes cluster. To install minikube: \
                (curl -Lo minikube curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.20.0/minikube-$(uname | awk '{print tolower($0)}')-amd64 && chmod +x minikube && mv minikube /usr/local/bin/)"; exit 1;}
        command -v kubectl          >/dev/null 2>&1 || { echo >&2 "I require kubectl. To install kubectl: \
                (curl -L -O https://storage.googleapis.com/kubernetes-release/release/v1.6.4/bin/$(uname | awk '{print tolower($0)}')/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/)"; exit 1;}
        command -v helm             >/dev/null 2>&1 || { echo >&2 "I require helm but it's not installed. To install helm: \
                (curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh && chmod 700 get_helm.sh && ./get_helm.sh)"; exit 1; }

        # minikube must be deleted and recreated if a disk resize is needed
        minikube start --disk-size 50g

        export MINIKUBE_IP=$(minikube ip)
        eval $(minikube docker-env)

        docker image inspect baseinstall:v1 >/dev/null 2>&1 && echo yes || echo no >/tmp/response.log 2>&1

        export IMAGE_RESPONSE=$(tail -1 /tmp/response.log)

        if [[ "$IMAGE_RESPONSE" == "no" ]]; then
          echo 'base installation docker image for koding was not found, building the image:\n'
          docker build -t baseinstall:v1 -f Dockerfile-k8s-base .
        fi

        export TILLER_POD_NAME=$(kubectl get pods -n kube-system -l app=helm  -o jsonpath="{.items[0].metadata.name}")
        k8s_health_check $TILLER_POD_NAME kube-system 5 120

      else
        # TODO: stop the cluster, maybe even have an option to kill the cluster?
        minikube stop
      fi
    }

    function k8s_health_check () {

      declare duration=0

      sleep $interval

      declare response_code=$(kubectl exec -n $2 $1 -c $5 -- echo 'i am alive')

      echo -n $5 : 'health-check : '

