Metricbeat Kubernetes Module

My kubernetes node is tls configured. I am tring to use the metricset node, system, pod, container and volume which would be fetched from https://IP_k8s:10255. It gives me logs saying "error making http request: Get https://IP_k8s:10255/stats/summary: http: server gave HTTP response to HTTPS client"

Hi @sukhada_sankpal369,

Couuld you share the settings you are using for the module? I'm wondering if you put httpsin the hosts field

metricbeat.modules:

Node metrics, from kubelet:

  • module: kubernetes
    protocol: https
    enabled: true
    metricsets:
    • node
    • system
    • pod
    • container
    • volume
      period: 10s
      in_cluster: true
      hosts: ["https://a.b.c.d:10255"]
      ssl.certificate_authorities: ["ca.pem"]
      ssl.certificate: "abc.pem"
      ssl.key: "abc-key.pem"

I tried using it without https. It was connecting using http.

Uhm, it looks to me like the service doesn't provide HTTPS, you can use http instead, I think that should work.

You can test this by hand, using curl for instance:
$ curl http://ip_k8s:10255/stats/summary
and
$ curl https://ip_k8s:10255/stats/summary

Which one is correct?

curl command works with https://ip_k8s:10255/stats/summary

What's the output of curl in both cases?

It is working fine with http.
How to check for
metricsets:
- state_node
- state_deployment
- state_replicaset
- state_pod
- state_container
using CURL??

Also, I am not able to see data related to POD and Node

That info comes from kube-state-metrics, you will need to launch this service in kubernetes: https://github.com/kubernetes/kube-state-metrics (check https://github.com/kubernetes/kube-state-metrics/tree/master/kubernetes)

then kube-state-metrics host dns should be available within the cluster, so you can use curl against it: curl http://kube-state-metrics:8080

Let me know how it goes

Hey Thanks!! I shall try this and let you know about it.
For now you may close the issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.