CheckMK CEE 2.0.0p1 - Can't monitor Kubernetes v1.19.6

We are using Kubernetes with Rancher. We are trying to use CheckMK to monitor our production Kubernetes Clusters.

I am getting the following error in CheckMK:

Cannot update tree(!), Found 1 inventory entries, [special_kubernetes] Agent exited with code 1: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({‘Server’: ‘nginx/1.19.2’, ‘Date’: ‘Fri, 23 Apr 2021 07:20:40 GMT’, ‘Content-Type’: ‘application/json’, ‘Content-Length’: ‘1331’, ‘Connection’: ‘keep-alive’, ‘Vary’: ‘Accept-Encoding’, ‘Audit-Id’: ‘0213a5a6-8c67-4f42-a9b2-de0182a364c1’, ‘Cache-Control’: ‘no-cache, private’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Strict-Transport-Security’: ‘max-age=15724800; includeSubDomains’}) HTTP response body: { “paths”: [ “/apis”, “/apis/”, “/apis/apiextensions.k8s.io”, “/apis/apiextensions.k8s.io/v1”, “/apis/apiextensions.k8s.io/v1beta1”, “/healthz”, “/healthz/etcd”, “/healthz/log”, “/healthz/ping”, “/healthz/poststarthook/crd-informer-synced”, “/healthz/poststarthook/generic-apiserver-start-informers”, “/healthz/poststarthook/max-in-flight-filter”, “/healthz/poststarthook/start-apiextensions-controllers”, “/healthz/poststarthook/start-apiextensions-informers”, “/livez”, “/livez/etcd”, “/livez/log”, “/livez/ping”, “/livez/poststarthook/crd-informer-synced”, “/livez/poststarthook/generic-apiserver-start-informers”, “/livez/poststarthook/max-in-flight-filter”, “/livez/poststarthook/start-apiextensions-controllers”, “/livez/poststarthook/start-apiextensions-informers”, “/metrics”, “/openapi/v2”, “/readyz”, “/readyz/etcd”, “/readyz/informer-sync”, “/readyz/log”, “/readyz/ping”, “/readyz/poststarthook/crd-informer-synced”, “/readyz/poststarthook/generic-apiserver-start-informers”, “/readyz/poststarthook/max-in-flight-filter”, “/readyz/poststarthook/start-apiextensions-controllers”, “/readyz/poststarthook/start-apiextensions-informers”, “/readyz/shutdown”, “/version” ] }(!!)

I tried to run the script from the filesystem

bin/python3 share/check_mk/agents/special/agent_kubernetes --debug --token TOKEN --infos nodes --no-cert-check --api-server-endpoint URL

I got a similar error message as I did in the GUI.

kubernetes.client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({‘Server’: ‘nginx/1.19.2’, ‘Date’: ‘Fri, 23 Apr 2021 08:14:53 GMT’, ‘Content-Type’: ‘application/json’, ‘Content-Length’: ‘1331’, ‘Connection’: ‘keep-alive’, ‘Vary’: ‘Accept-Encoding’, ‘Audit-Id’: ‘59aa21c8-990a-46a2-92f1-0ed052f4353e’, ‘Cache-Control’: ‘no-cache, private’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Strict-Transport-Security’: ‘max-age=15724800; includeSubDomains’})
HTTP response body: {
“paths”: [
“/apis”,
“/apis/”,

It is able to authenticate; it has access to them; but doesn’t know how to properly query them and generate services from them.

Found some related threads from 2020 and 2019:

Is there any update about support for Kubernetes versions 1.19, 1.20, 1.21 ?
We will soon upgrade Kubernetes to 1.20.

Kubernetes:
v1.19.6 RKE

Check_MK:
Enterprise Edition
2.0.0p1

That is a question for the team at GitHub - kubernetes-client/python: Official Python client library for kubernetes
The latest available lib version is v18.17 alpha and this supports only officially the Kubernetes v1.18

What i would do in your case is the following.

Create an empty site - install manually with pip3 the latest version of the Python lib.
Test from this empty site if you can query your Kubernetes.

Why to do this in an empty site? → You don’t want to mess up your Python libs in a production environment :slight_smile:

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.