1. 克隆项目
    git clone https://hub.fastgit.org/LBters/k8s-prometheus-grafana.git
  2. 安装node-exporter
    kubectl apply -f node-exporter.yaml
  3. 安装prometheus组件

    kubectl apply -f  k8s-prometheus-grafana/prometheus/rbac-setup.yaml
    kubectl apply -f  k8s-prometheus-grafana/prometheus/configmap.yaml
    kubectl apply -f  k8s-prometheus-grafana/prometheus/prometheus.deploy.yml
    kubectl apply -f  k8s-prometheus-grafana/prometheus/prometheus.svc.yml
  4. 安装 grafana 组件

    kubectl apply -f k8s-prometheus-grafana/grafana/grafana-deploy.yaml
    kubectl apply -f k8s-prometheus-grafana/grafana/grafana-svc.yaml
    kubectl apply -f k8s-prometheus-grafana/grafana/grafana-ing.yaml
  5. 查看组件服务的映射端口
    kubectl get svc -n kube-system
  6. 访问grafana并添加prometheus数据源
    IP+prometheus端口
  7. 选择Dashboards import导入模板
    输入url模板代码315 确定导入

可以看到prometheus监视列表已经出来了