kube-prometheus 使用 blackbox-exporter 进行TCP监控与 http 监控
前言
安装kube-prometheus
后默认在namespace的monitoring
中有创建 blackbox-exporter
的deployment。因此k8s中无需再部署blackbox-exporter
。
创建Probe资源
接下来,创建Probe资源来定义TCP和HTTP探测。可以使用以下YAML配置:
使用以下命令应用Probe配置:
检查Prometheus配置
确保Prometheus能够抓取到Probe的结果。可以在Prometheus的Web界面中查询probe_success
指标,值为1表示探测成功,0表示失败。
监控项
创建触发告警规则
参考
1.https://github.com/prometheus-operator/kube-prometheus/blob/release-0.9/docs/blackbox-exporter.md
2.https://blog.csdn.net/qq_31977125/article/details/132164695