agapoff / check_kubernetes

Nagios/Icinga/Zabbix style plugin for checking Kubernetes
64 stars 36 forks source link

most checks say no resource found #27

Closed fireba11 closed 1 year ago

fireba11 commented 1 year ago

I got several strange issues ...

./check_kubernetes.sh -m statefulsets -N namespace -n sts-name OK. Statefulset namespace/sts-name 3/3 ready

works fine while

./check_kubernetes.sh -m statefulsets -N namespace -n sts-name No statefulsets found

doesn't find anything. Same with most other checks, nodes and unboundpvc work while pvc doesn't and even gives jq errors:

jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) OK. No problem on 0 pvc storage

Also tried using -H and -T to not use kubectl, but didn't change anything.

Any ideas?

fireba11 commented 1 year ago

I managed to narrow it down to scriptpath with -n works, the one without is broken.

fireba11 commented 1 year ago

Using $NAME without ever defining it was a bad idea. It's an ENV on WSL m( Will make a pull request with a fix after looking at the jq errors for pvc mode.