kubernetes clusterr monitor prometheus+Grafana集群资源监控

tsdb 时序数据库 默认保存60天的数据,若需要持久保存,需要额外的添加外部存储
prometheus主动拉取jobs/exporters数据
prometheus主动拉取pushgateway临时数据 ,short-lived jobs主动推临时数据至pushgateway
alertmanager 报警行为,独立组件,不属于prometheus
systemctl enable —now SERVICESNAME
 
 
 
1、监控指标
  • 集群监控
    • 节点资源利用率
    • 节点数量
    • 运行多少个pod
  • Pod监控
    • 容器指标
    • 应用程序
2、监控平台 prometheus+Grafana
  • prometheus:定时抓取被监控组件状态数据,通过http协议进行系统监控,将收集的数据进行存储基于数据库的方式使用(适用虚拟化,容器化环境)
    • 开源
    • 监控、报警、数据库
    • 以HTTP协议周期性抓取被监控组件状态
    • 不需要复杂的集成过程,使用http接口接入即可
  • Grafana:通过prometheus抓取的数据进行展示,可视化工具
    • 开源的数据分析和可视化工具
    • 支持多种数据源
notion image
3、搭建监控平台
  • 部署prometheus
    • 部署守护进程 node-exporter.yaml
    • rbac-setup.yaml 设置权限
    • configmap.yaml 存储
    • prometheus.deploy.yml 部署过程
    • prometheus.svc.yml 暴露端口
  • 部署grafana
    • grafana-deploy 部署过程
    • grafana-svc 暴露端口
    • grafana-ing 使用ingress

补充

模板
操作指南
notion image
Loading...
目录