LoginSignup
0
0

More than 1 year has passed since last update.

[Kubernetes] システムメトリクス簡単に整理した (Prometheus)

Posted at

システムメトリクスの種類

メトリクスを収集可能にするやつ 集めるメトリクス PrometheusOperatorのCRD Prometheusのscrape role メトリクス例
prometheus/node_exporter (DaemonSet) hardware and OS metrics (*NIX kernelからExposeされるもの) PodMonitor pod node_cpu_seconds_total, node_disk_io_time_seconds_total
kubernetes/kube-state-metrics (Deployment) Kubernetes オブジェクトのステート ServiceMonitor endpoints kube_storageclass_created
kubelet (各ノード) コンテナメトリクス cadvisor, resource, probes ServiceMonitor endpoints kubelet_volume_stats_available_bytes
kubernetes-sigs/metrics-server (Deployment) オートスケーリングパイプライン(HPAとかVPA)用のコンテナメトリクス Monitoring ツールで集めない Monitoring ツールで集めない なし

ダイアグラム

metrics.png

コメント:

  • システムメトリクスのソースは、3つ kube-api-server, kubeletとHostのKernel
  • Prometheusは、それぞれkube-api-serverkube-state-metrics経由、 kubeletはPrometheusから直接Scrape、Hostはnode_exporterを経由してメトリクス収集
  • PrometheusOperatorを使わなくてももちろんMonitoringできる
  • PrometheusOperatorは、PodMonitorServiceMonitorによって、Prometheusのscrapeのconfigを設定できるようにしてくれる
  • PrometheusのMetricsをCustomMetricsAPIにしてHPA/VPAをするともっと図が複雑になる(今回は書いてない)
  • Prometheusのadditional-scrape-configを使ってもkubeletのメトリクスを取得できるがどちらがいいのかは現状よくわからず
  • metrics-serverはkubectl topでcontainerのmemoryとcpu使用率を表示するのにも使用される

参考

- https://github.com/prometheus-operator/prometheus-operator
- https://github.com/kubernetes-sigs/metrics-server
- https://github.com/prometheus/node_exporter
- prometheus-operatorでPodのメトリクスを収集する
- Metrics For Kubernetes System Components

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0