agapoff / check_kubernetes

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

ComponentStatus is deprecated in v1.19+ #17

Closed ebourg closed 3 years ago

ebourg commented 3 years ago

Hi,

check_kubernetes.sh -m components fails with Kubernetes 1.19 with the following error:

parse error: Invalid numeric literal at line 1, column 8

It seems to be caused by a warning message displayed before the JSON payload after calling api/v1/componentstatuses:

Warning: v1 ComponentStatus is deprecated in v1.19+{"apiVersion": "v1","items":...
ebourg commented 3 years ago

From the Kubernetes 1.19 changelog:

Kube-apiserver: the componentstatus API is deprecated. This API provided status of etcd, kube-scheduler, and kube-controller-manager components, but only worked when those components were local to the API server, and when kube-scheduler and kube-controller-manager exposed unsecured health endpoints. Instead of this API, etcd health is included in the kube-apiserver health check and kube-scheduler/kube-controller-manager health checks can be made directly against those components' health endpoints.

agapoff commented 3 years ago

I had no luck to work with 1.19 yet.

agapoff commented 3 years ago

Right. This API method is deprecated in 1.19+, so the components mode should be deprecated too. I have added the appropriate comment in help and readme.