
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: hello-health
data: 
  run-health-script.sh: |
    script_dir=/script;
    while true; do 
    echo "<b>BUC Kube Health:</b><br><table style=\"\">"  > /httproot/index.html
      for check in $(find /script -maxdepth 1 -name 'health_*' | sort); do
        echo $check
        echo "<tr><td valign=\"top\">$(echo $check | cut -f 3 -d _ ): </td><td>$(sh $check)</td></tr>" >> /httproot/index.html
      done
      echo "</table><br> $(date)" >> /httproot/index.html

      sleep 60
    done
  health_000_Up: echo Up
  health_001_Ingress: curl -s -o /dev/null -w "%{http_code}" http://hello.kube.buc.local
  health_002_Dashboard: |
    echo "Kube Dashboard: $(curl -s -o /dev/null -w \"%{http_code}\" -k https://kube.buc.local:30037) <br>"
    echo "OKD Console:    $(curl -s -o /dev/null -w \"%{http_code}\" http://kube.buc.local:30036) <br>"
  health_003_Argo: curl -s -o /dev/null -w "%{http_code}" http://argocd.kube.buc.local

    
