Failed to establish connection for kubernetes cluster monitoring

CMK version:
OS version: Ubuntu 20.4

Error message: Kubernetes monitoring: [special_kube] Agent exited with code 1: Failed to establish connection to xxx.xxx.xx.x:6443 at URL /version

I am new to checkmk and I am trying to monitor a kubernetes cluster within a VM running checkmk. Whenever I complete the documentation and get to the point of checking the connection it fails complaining it cannot establish a connection.

My assumption is that there is a network issue going on. Maybe I am using the incorrect IP addresses and ports for the setup of the kubernetes rule.

For the option requesting the “control plane IP”. I am using the cluster IP I see under the below command. And the port 6443 . I am able to hit this IP address.

kubectl get nodes -o wide

for the “service url IP” I am using the internal IP i see when I run the below command . And the port 30035 which was configured for nodeport in the yaml file . I am unable to hit this IP address

kubectl get service

I am banging my head against the wall on this one but I think I am close to a solution. any suggestions are greatly appreciated.

You would be using the External IP of the node itself for both options as the “internal-IP” is exactly that which is Internal to the cluster only. So if your VM was say 192.168.1.200 and you exported the NodePort 30035 for the cluster collector the address would be

http://192.168.1.200:30035

and for the Control plane I believe you had that correct but in this example it would be

https://192.168.1.200:6443

of course assuming the ApiServer is listening on 6443 but it looks like you may have to forward it with minikube: minikube - How to access Kubernetes API when using minkube? - Stack Overflow

Overall you also probably need to make sure that the checkmk site can even reach the Kubernetes node normally.

Zack! thanks for the input on this. It works!

Hope this helps other minikube users. :slight_smile: