k8s集群略過,之前有發布過k8s高可用集群博客,可以訪問連接
https://www.cnblogs.com/lfl17718347843/p/13417304.html
1.克隆github項目
https://gitee.com/liugpwwwroot/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.訪問Prometheus ip+port
7.訪問node-exporter ip+port
8.訪問grafana並添加數據源 ip+port
9.導入模板