受教了,明白了 感谢大佬指导
kubesphere监控pod cpu
大佬我想修改告警消息的模板怎么修改呢?
Annotations:
- aliasName = demo-pod-memory
- message = demo-pod-memory(内存使用率) >=85%
- rule_update_time = 2022-04-21T07:46:24Z
- summary = demo-pod-memory >=85%
Labels:
- alertname = demo-pod-memory
- alerttype = metric
- cluster = default
- pod = order-2
- rule_id = 1a925d2b8e96f65656e54
- severity = error
Annotations:
- aliasName = demo-pod-memory
- message = demo-pod-memory(内存使用率) >=85%
- rule_update_time = 2022-04-21T07:46:24Z
- summary = demo-pod-memory >=85%
我想在这段信息中加上namespace字段 大佬指教一下 谢谢
message: 'Pod:{{ $labels.pod }}, Namespace:{{ $labels.namespace }}, CPU utilization is large than 70%, Current Value:{{ $value | printf "%.2f%%" }}.'
summary: 'Pod:{{ $labels.pod }}, CPU utilization is large than 70%'
expr: (sum by(pod,namespace) (irate(container_cpu_usage_seconds_total{container!="",container!="POD",namespace="$REPLACE_WITH_YOUR_NAMESPACE",pod=~".*$REPLACE_WITH_YOUR_POD.*"}[3m]))) / (sum by(pod,namespace) (kube_pod_container_resource_limits_cpu_cores{namespace="$REPLACE_WITH_YOUR_NAMESPACE",pod=~".*$REPLACE_WITH_YOUR_POD.*"})) * 100 > 70
将 $REPLACE_WITH_YOUR_NAMESPACE,$REPLACE_WITH_YOUR_POD 替换成你需要的
Nrehearsal 嗯呢 已经解决了 感谢大佬
大佬 咱们kubesphere告警可以去掉自带的告警吗 还有就是怎么配置多个钉钉群告警呢?
自带策略在这里
kubectl get -n kubesphere-monitoring-system prometheusrules.monitoring.coreos.com prometheus-k8s-rules -o yaml
结构大概这样name->rules->rule,你按需调整rule应该就可以。
钉钉设置多个通知群,不太清楚,你重新发个帖子问问吧。
这个貌似不太对,在集群节点管理里面
显示的 CPU 用量是:
50%
56.05/112 核
这个是按照 CPU 核数来计算的
frezesK零S
- 已编辑
LYN
不是,这里的利用率也是 pod resource usage / pod resource limit
可以参考: https://kubernetes.io/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/
https://kubernetes.io/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/