Monitoring
Using the Ops Project to View and Monitor Cluster Events
· β˜• 3 min read
https://github.com/shaowenchen/ops 1. Alerting on Kubernetes Cluster Events Monitor specified keywords 1 2 3 4 5 6 7 8 9 10 11 apiVersion: crd.chenshaowen.com/v1 kind: EventHooks metadata: name: kube-pod-falid namespace: ops-system spec: type: xiezuo url: https://xxx.com/api/v1/webhook/send?key=xxx subject: "ops.clusters.*.namespaces.*.pods.*.event" keywords: - failed A simple configuration like this yields a large number of related alerts.

Why top node, free, and Grafana Numbers Don't Line Up
· β˜• 5 min read
1. top Shows Node Resource Usage Above 100% 1 2 3 4 5 6 kubectl top node NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% master-1 995m 16% 13760Mi 118% master-2 827m 13% 10672Mi 92% master-3 889m 14% 10244Mi 88% This is because usage is computed against allocatable resources by default, which excludes the portion reserved by Kubelet.

Zero-Cost Service Availability Monitoring with Upptime
· β˜• 3 min read
1. What Needs Dial Testing GPT was all the rage this year, and I deployed and developed several applications and mini programs to learn from. Of course, following the principle of helping vendors test their features, right now only the GPT 3.5 API costs a little every day β€” the

Using In-Cluster Prometheus to Collect Etcd Metrics
· β˜• 2 min read
1. Skipping Certificate Verification Prevents Scraping If you can skip TLS authentication when scraping metrics, that is the easiest path. The Prometheus ConfigMap configuration looks like this: 1 2 3 4 5 6 7 8 9 - job_name: etcd metrics_path: /metrics scheme: https tls_config: insecure_skip_verify: true static_configs: - targets: ["1.1.1.1:2379"] - targets: ["2.

How to Estimate Prometheus's Local Storage and Memory Consumption
· β˜• 2 min read
1. Local Storage Capacity Required disk size (GB) = data retention period _ samples fetched per second _ metric data size / 1024 / 1024 / 1024 Where Samples fetched per second: rate(prometheus_tsdb_head_samples_appended_total[1d]) Average size of a sample within one hour: rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d])/rate(prometheus_tsdb_compaction_chunk_samples_sum[1d]) The disk consumption for one day (86400 seconds) can be queried directly in Prometheus: