可观测性
使用 Kindling 观测 Kubernetes 的网络连接
· ☕ 3 分钟
最近有一个需求,收集 Kubernetes 的外网访问情况。因此对相关项目进行了调用和试用,本篇主要是介绍如何安装 Kindling,配置 Grafana 查看 Kubernetes 网络连接数据。 1. 什么是 Kindling Kindling 解决的是,在不入侵应用的前提下,如何观测网络的问题,其功能主要是通过暴露内核事件来实现观测。

如何采集 Kubernetes 对象的 labels 和 annotations
· ☕ 2 分钟
1. 为什么需要 kube-status-metrics Kubernetes 的监控主要关注两类指标: 基础性能指标 CPU、内存、磁盘、网络等指标,可以通过 DaemonSet 部署 node-exporter,由 Prometheus 抓取相关指标。 资源对象指标 Deployment 的副本数量、Pod 的运行状态等。这些指标需要 kube-status-metrics 轮询 Kubernetes 的 API 查询,并暴露给 Prometheus 才能够看到

海外多区下的监控系统
· ☕ 4 分钟
1. 相关背景 待在工作岗位上,总得做点事,也想做点新鲜事。但并不是你想做就有机会去做,并能做好。 一个人做、还是能和大家一起做,最终的结果是不一样的。这就涉及到时机,大家能否达成一致的动机。 今年是降本增效的一年,很多公司在裁员、减配降本。因此,对

二进制部署 Thanos
· ☕ 1 分钟
1. 下载二进制文件 1 2 3 4 wget https://github.com/thanos-io/thanos/releases/download/v0.26.0/thanos-0.26.0.linux-amd64.tar.gz tar xvf thanos-0.26.0.linux-amd64.tar.gz mv thanos-0.26.0.linux-amd64/thanos /usr/bin/ rm -rf thanos-0.26.0.linux-amd64* 2. 安装 Thanos Query 1 vim /etc/systemd/system/thanos-query.service 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [Unit] Description=Thanos Query After=network-online.target [Service] Restart=on-failure ExecStart=/usr/bin/thanos query \ --log.level=debug \ --query.auto-downsampling \ --grpc-address=0.0.0.0:30091 \ --http-address=0.0.0.0:30092 \ --query.partial-response \ --query.replica-label=prometheus_replica \ --query.replica-label=rule_replica \ --store=1.0.0.0:30091 \ --store=2.0.0.0:30091 [Install] WantedBy=multi-user.target --store 参数添加需要聚合的全部源。 1 systemctl daemon-reload && systemctl enable thanos-query 1 systemctl start thanos-query && systemctl status thanos-query 3. 安装 Thanos Sidecar 1 vim /etc/systemd/system/thanos-sidecar.service 1 2 3 4 5

Thanos 进阶使用指南
· ☕ 4 分钟
1. 使用 Query 聚合数据 如上图,Thanos Query 可以对接的组件有: Thanos Store Gateway Thanos Query Thanos Receive Prometheus,借助于 Sidecar 利用 Thanos Query 之间的级联,我们可以实现跨组件的关联查询,组建超大型的监控系统。这也意味着,每个对接的组件应该提供足够快的 Prometheus API。整个接口的响应时