How to Deploy our Customize Thingsboard to Kubenetes Engine?

3/14/2018

After make docker image of cassandra, cassandra-setup, application and zookeeper from my custom thingsboard. I tried to deploy that to Kubernetes Engine, there's no error, but not running well.

Here is my command for yaml from my github:

curl -L https://raw.githubusercontent.com/Firdauzfan/ThingsboardGSPE/master/docker/k8s/common.yaml > common.yaml

curl -L https://raw.githubusercontent.com/Firdauzfan/ThingsboardGSPE/master/docker/k8s/cassandra.yaml > cassandra.yaml

curl -L https://raw.githubusercontent.com/Firdauzfan/ThingsboardGSPE/master/docker/k8s/zookeeper.yaml > zookeeper.yaml

curl -L https://raw.githubusercontent.com/Firdauzfan/ThingsboardGSPE/master/docker/k8s/tb.yaml > tb.yaml

curl -L https://raw.githubusercontent.com/Firdauzfan/ThingsboardGSPE/master/docker/k8s/cassandra-setup.yaml > cassandra-setup.yaml

and here is my docker image: https://hub.docker.com/u/firdauzfanani/

Example: when i run command kubectl create -f cassandra.yaml, cassandra engine just show running but not ready.

Status screenshot here

-- Firdauz Fanani
google-cloud-platform
google-kubernetes-engine
kubernetes
kubernetes-health-check
thingsboard

1 Answer

3/14/2018

If it is shown as not ready even if it is running with no issue (es: you can ssh into it and all the services are running), could be an misconfiguration of your redinessprobe that I see defined in the YAML file as follow, but I have no clue regarding its behaviour. Consider that accordingly to documentation it should return 0.

readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - /ready-probe.sh

On the other hand, if when you try to access the pod you face some kind of errors, I would suggest you if you didn't do it already to retrieve further information to carry on the troubleshooting running the following commands:

$ kubectl describe deployments
$ kubectl describe pods
$ kubectl describe services

This series of commands could help you in order to understand better what is going on.

Please run them and edit your initial post with the output and I can take a look to them.

To ssh into the pod run:

$ kubectl get pods (to retrieve pod name)
$ kubectl exec -ti PODNAME  /bn/bash 

UPDATE I deployed your YAML files, the pods is running correctly (I believe) what is failing is the probe whose content is the following:

cat /ready-probe.sh
if [[ $(nodetool status | grep $POD_IP) == *"UN"* ]]; then
  if [[ $DEBUG ]]; then
    echo "UN";
  fi
  exit 0;
else
  if [[ $DEBUG ]]; then
    echo "Not Up";
  fi
  exit 1;
-- GalloCedrone
Source: StackOverflow