k8s 添加 Prometheus+Grafana的監控
#安裝git,下載yaml
git clone https://github.com/redhatxl/k8s-prometheus-grafana.git
#安裝node-exporter
kubectl create -f node-exporter.yaml
#安裝prometheus組件
kubectl create -f k8s-prometheus-grafana/prometheus/rbac-setup.yaml
kubectl create -f k8s-prometheus-grafana/prometheus/configmap.yaml
kubectl create -f k8s-prometheus-grafana/prometheus/prometheus.deploy.yml
kubectl create -f k8s-prometheus-grafana/prometheus/prometheus.svc.yml
#安裝 grafana 組件
kubectl create -f k8s-prometheus-grafana/grafana/grafana-deploy.yaml
kubectl create -f k8s-prometheus-grafana/grafana/grafana-svc.yaml
kubectl create -f k8s-prometheus-grafana/grafana/grafana-ing.yaml
查看組件服務的映射端口
訪問
1、prometheus http://ip:30003 2、grafana http://ip:31112 (默認用戶密碼 admin admin)
3、配置grafana 數據源為prometheus
4、導入dashboard面板
查看grafana 監控圖標
參考:http://www.pianshen.com/article/5359214306/