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/
所有评论(0)