Kubernetes: How to get disk / cpu metrics of a node

前端 未结 2 1128
轮回少年
轮回少年 2021-02-05 20:25

Without using Heapster is there any way to collect like CPU or Disk metrics about a node within a Kubernetes cluster?

How does Heapster even collect those metrics in the

2条回答
  •  失恋的感觉
    2021-02-05 21:00

    I would recommend using heapster to collect metrics. It's pretty straight forward. However, in order to access those metrics, you need to add "type: NodePort" in hepaster.yml file. I modified the original heapster files and you can found them here. See my readme file how to access metrics. More metrics are available here.

    Metrics can be accessed via a web browser by accessing http://heapster-pod-ip:heapster-service-port/api/v1/model/metrics/cpu/usage_rate. The Same result can be seen by executing following command.

    $ curl -L http://heapster-pod-ip:heapster-service-port/api/v1/model/metrics/cpu/usage_rate   
    

提交回复
热议问题