Skip to content

xiaozongyang/kube-node-metrics

Repository files navigation

This project is licensed under the MIT License.

This project is inspired by kube-state-metrics and kubectl.

This project is exposted kubernetes node resource metrics to prometheus. Following Metrics will be exposed.

kube_node_metrics_cpu_request
kube_node_metrics_cpu_limit
kube_node_metrics_mem_request_bytes
kube_node_metrics_mem_limit_bytes

These samples values should be equal to the result of kubectl describe node <node>.

Getting started

Available docker images can be fount in docker hub.

Try in Minikube

Please ensure you have minikube installed.

Run with following commands in your terminal:

minikube start
kubectl apply -f deploy.yaml

Run in Kubernetes

kubectl apply -f deploy.yaml

Build

build binary manually

go build .

build docker image

docker build . -t <image>:<tag>

Operating

This exporter also exposed a metric kube_node_metrics_last_full_sync_ok_time_seconds which indicates the last full sync timestamp in seconds. You can create alert rule to monitor the exporter health with the expression time() - kube_node_metrics_last_full_sync_ok_time_seconds > 300 and you will receive alert if the exporter is not sync sucessfully for 300 seconds.

TODO

  1. support exposed node labels match given pattern

About

This project is exposted kubernetes node resource requests and limist metrics to prometheus.

Topics

Resources

License

Stars

Watchers

Forks