涉及檔案下載下傳位址:連結:https://pan.baidu.com/s/18XHK7ex_J0rzTtfW-QA2eA 密碼:0qn6
檔案中需要下載下傳的鏡像需要自己提前下載下傳好,eg:prom/node-exporter:v0.16.0
Prometheus官方網址,或者百度自己了解腦補:https://prometheus.io/

連結==-==Kubernetes Dashboard 安裝,快速,簡便運作Dashboard
環境如下:Docker for Mac 或者 Edge 版本的内置的 Kubernetes 叢集
指令檢視環境資訊
Kubernetes的Dashboard
在kubernetest中建立namespace叫做ns-monitor
建立檔案名:namespace.yaml,内容如下:
【檔案在百度雲盤可下載下傳連結:https://pan.baidu.com/s/18XHK7ex_J0rzTtfW-QA2eA 密碼:0qn6】
在檔案目錄處,執行建立指令如下:
在kubernetest中部署node-exporter,Node-exporter用于采集kubernetes叢集中各個節點的實體名額,比如:Memory、CPU等。可以直接在每個實體節點是直接安裝,這裡我們使用DaemonSet部署到每個節點上,使用 hostNetwork: true 和 hostPID: true 使其獲得Node的實體名額資訊,配置tolerations使其在master節點也啟動一個pod。
建立檔案名:node-exporter.yaml檔案,内容如下:
檢視建立是否成功:
檢驗node-exporter是否都成功運作
http://127.0.0.1:31672/metrics或者http://127.0.0.1:9100/metrics
在kubernetest中部署Prometheus
官方參考文檔:/etc/prometheus/prometheus.yaml的配置
建立檔案名prometheus.yaml,内容如下:
執行建立指令
驗證prometheus的正确性:http://127.0.0.1:31710/graph 或者 http://127.0.0.1:31710/service-discovery 或者 http://127.0.0.1:31710/targets
在kubernetest中部署grafana
建立grafana.yaml檔案,内容如下:
執行建立指令、并檢視
驗證grafana是否成功運作:http://127.0.0.1:30591/login 預設使用者名和密碼:admin/admin
配置grafana:把prometheus配置成資料源
http://prometheus-service.ns-monitor:9090這個連結的來源:
然後導入Dashboard
再把 kubernetes的Dashboard的模闆導入進來顯示:直接把JSON格式内容複制進來就行
參考blog:https://blog.csdn.net/chenleiking/article/details/80009529
參考官網:https://prometheus.io/