2. Copyright 2016 ITRI 工業技術研究院
個人簡介
• 任博煜 Kevin Jen
• 工研院資通所
• 資料中心與雲端應用軟體組
• 協助整合以及維運由Kubernetes
搭建的 ITRI DNN Farm
3. Copyright 2016 ITRI 工業技術研究院
Tools
Prometheus
This is the central piece, it contains the time series database and the logic of scraping stats from
exporters (see below) as well as alerts.
Node-exporter
A Node Exporter to export system metrics in a Prometheus-compatible format.
There are many other types of expoter ,like container expoter or snmp expoter.
Nvidia-smi-exporter
nvidia-smi metrics exporter for Prometheus
Grafana
A web-based graphical dashboard builder that supports Prometheus
4. Copyright 2016 ITRI 工業技術研究院
What is Prometheus
• Prometheus is an open-source systems monitoring and alerting toolkit originally built
at SoundCloud.
• Since its inception in 2012, many companies and organizations have adopted Prometheus,
and the project has a very active developer and user community. It is now a standalone open
source project and maintained independently of any company.
• To emphasize this and clarify the project's governance structure, Prometheus joined
the Cloud Native Computing Foundation in 2016 as the second hosted project
after Kubernetes.
5. Copyright 2016 ITRI 工業技術研究院
Features
• A multi-dimensional data model (time series identified by metric
name and key/value pairs)
• A flexible query language to leverage this dimensionality
• Targets are discovered via service discovery or static configuration
6. Copyright 2016 ITRI 工業技術研究院
Grafana
• Grafana is an open source metric analytics & visualization suite.
• Prometheus delegates the heavy lifting of proper graphical displays and dashboards to
Grafana.
• Grafana features pluggable panels and data sources allowing easy extensibility and a
variety of panels, including fully featured graph panels with rich visualization options.
• Easily create alert rules from within the UI and have them be continually evaluated by the
Grafana backend.
Kubernetes在1.7.0之後啟用了RBAC特性,因此我們需要先通過RBAC授權,
然後Prometheus通過RBAC連接Kubernetes集群,否則被拒絕後,將無法連接到K8s的API-SERVER
prometheus.rbac.yml定義了Prometheus容器訪問k8s apiserver所需的
ServiceAccount和ClusterRole及ClusterRoleBinding,確保Prometheus可以訪問到kubernetes API
官方github:
https://github.com/prometheus/prometheus/tree/master/documentation/examples
Role-based access control
Service用來暴露服務
在Service中定義標註prometheus.io/scrape: 'true',表明該Service需要被prometheus發現並採集數據
用於監控底層的服務器指標,官方解釋:
Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors.
如果在Pod中使用hostNetwork:true配置的話。在主機的所有網絡接口上都可以訪問到該應用程序。