当前位置: 首页 > news >正文

kube-prometheus-stack基础上部署balckbox-exporter监控域名ssl证书过期时间

导入proemtheus-community

[root@ip-172-31-26-146 ~]# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts "prometheus-community" already exists with the same configuration, skipping

自定义values.yaml

config:modules:http_2xx:prober:httptimeout:5shttp:valid_http_versions:["HTTP/1.1","HTTP/2.0"]follow_redirects:truepreferred_ip_protocol:"ip4"serviceMonitor:enabled:falsedefaults:labels:release:kube-prometheus# 在这里把你的域名都列出来,它们会合并进同一个 ServiceMonitortargets:-name:parasail-homepageurl:https://a.networkinterval:1mscrapeTimeout:10smodule:http_2xx-name:starboard-venturesurl:https://b.venturesinterval:1mscrapeTimeout:10smodule:http_2xx-name:spacescope-iourl:https://c.iointerval:1mscrapeTimeout:10smodule:http_2xx

部署blackbox-exporter

[root@ip-172-31-26-146 ~]# helm install blackbox prometheus-community/prometheus-blackbox-exporter -n monitoring -f values.yamlNAME: blackbox LAST DEPLOYED: Tue Dec1607:34:182025NAMESPACE: monitoring STATUS: deployed REVISION:1TEST SUITE: None NOTES: See https://github.com/prometheus/blackbox_exporter/forhow to configure Prometheus and the Blackbox Exporter.1. Get the application URL by running these commands:exportPOD_NAME=$(kubectl get pods --namespace monitoring -l"app.kubernetes.io/name=prometheus-blackbox-exporter,app.kubernetes.io/instance=blackbox"-ojsonpath="{.items[0].metadata.name}")exportCONTAINER_PORT=$(kubectl get pod --namespace monitoring $POD_NAME -ojsonpath="{.spec.containers[0].ports[0].containerPort}")echo"Visit http://127.0.0.1:8080 to use your application"kubectl --namespace monitoring port-forward$POD_NAME8080:$CONTAINER_PORTubectl--namespace default port-forward$POD_NAME8080:$CONTAINER_PORT

编写ServiceMonitor

apiVersion:monitoring.coreos.com/v1kind:ServiceMonitormetadata:name:blackbox-exporter# 只有一个名字namespace:monitoringlabels:release:kube-prometheus# 确保这与你的 Prometheus Operator 匹配spec:# 1. 这里非常关键:我们要选择 Blackbox Exporter 的 Service# 这样 Prometheus 才知道要把请求发给谁selector:matchLabels:app.kubernetes.io/instance:blackbox-parasailapp.kubernetes.io/name:prometheus-blackbox-exporter# 2. 这里定义“我们要监控谁”# 所有的域名都写在 endpoints 列表里,但它们属于同一个 ServiceMonitor 对象endpoints:# --- 第 1 个域名 ----port:httppath:/probeinterval:1mscrapeTimeout:10sparams:module:["http_2xx"]target:["https://parasail.network"]# 目标写在这里metricRelabelings:# 可选:为了让图表好看,把 target 重命名为 instance-sourceLabels:[__param_target]targetLabel:instance# --- 第 2 个域名 ----port:httppath:/probeinterval:1mscrapeTimeout:10sparams:module:["http_2xx"]target:["https://starboard.ventures"]# --- 第 3 个域名 ----port:httppath:/probeinterval:1mscrapeTimeout:10sparams:module:["http_2xx"]target:["https://spacescope.io"]

部署ServiceMonitor

[root@ip-172-31-26-146 prometheus-blackbox-exporter]# kubectl apply -f servicemonitor.yamlservicemonitor.monitoring.coreos.com/blackbox-exporter created
[root@ip-172-31-26-146 prometheus-blackbox-exporter]# helm list -n monitoringNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION blackbox monitoring42025-12-16 09:16:24.838617309 +0000 UTC deployed prometheus-blackbox-exporter-11.6.1 v0.28.0
http://www.cnnetsun.cn/news/93606.html

相关文章:

  • 速藏!AI大模型工程师进阶手册:从入门到实战的全攻略
  • NVIDIA Profile Inspector终极优化指南:解锁显卡隐藏性能
  • Ubuntu执行apt-get update报错:W: 无法下载 http://cn.mirrors.ustc.edu.cn/ubuntu/dists/bionic/InRelease 连接失败
  • LobeChat能否对接古籍数据库?中华传统文化智能问答系统
  • 微信多设备登录难题的终极解决方案
  • PlayCover深度解密:在Mac上畅享iOS应用的终极方案
  • RGBD slam
  • BBDown完全指南:轻松下载B站视频的5大实用技巧
  • 历时两年多,“水下大疆”IPO又有新进展! 深之蓝海洋科技股
  • MusicFree插件完全指南:解锁个性化音乐体验的终极教程
  • 显卡驱动终极清理方案:Display Driver Uninstaller完整使用指南
  • 5分钟从入门到精通!PandaWiki:零代码小白的AI编程助手
  • 基于JAVA的图书馆图书资源检索借阅系统
  • 原神自动化脚本7大实用技巧:新手也能快速上手的完整指南
  • 基于Java的奖学金评定评优系统的设计与实现
  • 03-编写和运行Playbook
  • 如何用Locale Emulator实现完美区域语言模拟:新手终极指南
  • Java与操作系统常用命令交互全解析
  • Mac微信防撤回插件WeChatIntercept:终极完整使用指南
  • LobeChat能否实现AI律师函撰写?法律文书自动化产出
  • 基于Python的在线零食购物商城系统的设计与实现
  • 小爱音箱AI升级终极指南:三步打造你的智能语音管家
  • 如何设计吸引眼球的放假通知图片
  • Wallpaper Engine终极下载指南:免费获取创意工坊壁纸的完整教程
  • 终极指南:如何用QtScrcpy实现零延迟Android投屏控制
  • 华为认证的证书含金量到底怎么样?谁适合考?谁没必要浪费时间?
  • 六音音源重生之路:让洛雪音乐重获新生
  • QtScrcpy跨平台投屏终极指南:让你的手机在电脑上“活“起来
  • 鸣潮自动化工具终极指南:5分钟实现全自动游戏体验
  • 百度网盘提取码智能获取工具使用全攻略