I'm looking to get the kubelet_* metrics from EKS/GKE servers.
neither metrics-server
or kube-state-metrics
seem to provide them to prometheus. Information online suggests the metrics are coming from the kubelet itself, but I'm not precisely sure which software piece is usually used to provide those metrics.
I seem to be able to do a --raw query on the node to get the information, but I'd rather not write my own exporter for that. :)
CodePudding user response:
It's true that kubelet exposes kubelet_*
metrics. By default they're available on port 10250
, path /metrics
. Additionally, kubelet also has metrics in /metrics/cadvisor
, /metrics/resource
and /metrics/probes
endpoints.
I'm running a self-managed Prometheus deployment and use this config to scrape kubelet metrics:
- job_name: 'kubelet'
scheme: https
# these are provided by the service account I created for Prometheuse
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
# map node labels to prometheus labels
- action: labelmap
regex: __meta_kubernetes_node_label_(. )