k8s 添加 Prometheus+Grafana的监控
#安装git,下载yamlgit clone https://github.com/redhatxl/k8s-prometheus-grafana.git#安装node-exporterkubectl create -f node-exporter.yaml #安装prometheus组件kubectl create -f k8s-prometheus-grafana/prometheus/rbac-setup.yamlkubectl 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.yamlkubectl create -f k8s-prometheus-grafana/grafana/grafana-svc.yamlkubectl create -f k8s-prometheus-grafana/grafana/grafana-ing.yaml
查看组件服务的映射端口
访问1、prometheus http://ip:30003 2、grafana http://ip:31112 (默认用户密码 admin admin)3、配置grafana 数据源为prometheus4、导入dashboard面板 查看grafana 监控图标参考:http://www.pianshen.com/article/5359214306/