简体   繁体   English

Prometheus 计算 Pod 的 memory 和 CPU 利用率

[英]Calculate the memory and CPU utilization for pods by Prometheus

I'm trying to find the sutiable expression to set alert that can calculate the Pods utlization that are reaching 80% for both memory and CPU on all the pods that are exisiting on namespace so i appreciate if can someone help me to achieve that我正在尝试找到合适的表达式来设置警报,该警报可以计算 memory 和 CPU 在命名空间上存在的所有 Pod 上达到 80% 的 Pod 利用率,所以如果有人可以帮助我实现这一目标,我将不胜感激

The Kubernetes ecosystem includes two complementary add-ons for aggregating and reporting valuable monitoring data from your cluster: Metrics Server and kube-state-metrics. Kubernetes 生态系统包括两个互补的附加组件,用于从集群聚合和报告有价值的监控数据:Metrics Server 和 kube-state-metrics。

Metrics Server collects resource usage statistics from the kubelet on each node and provides aggregated metrics through the Metrics API . Metrics Server从每个节点上的 kubelet 收集资源使用统计信息,并通过Metrics API提供聚合指标。 Metrics Server stores only near-real-time metrics in memory, so it is primarily valuable for spot checks of CPU or memory usage, or for periodic querying by a full-featured monitoring service that retains data over longer timespans. Metrics Server 仅在 memory 中存储近乎实时的指标,因此它主要用于 CPU 或 memory 使用情况的抽查,或通过功能齐全的监控服务进行定期查询,该服务在更长的时间跨度内保留数据。

kube-state-metrics is a service that makes cluster state information easily consumable. kube-state-metrics是一项使集群 state 信息易于使用的服务。 Whereas Metrics Server exposes metrics on resource usage by pods and nodes, kube-state-metrics listens to the Control Plane API server for data on the overall status of Kubernetes objects (nodes, pods, Deployments, etc.), as well as the resource limits and allocations for those objects. Metrics Server 公开有关 pod 和节点资源使用情况的指标,kube-state-metrics 监听控制平面 API 服务器以获取有关 Kubernetes 对象(节点、pod、部署等)以及资源的整体状态的数据这些对象的限制和分配。 It then generates metrics from that data that are available through the Metrics API.然后,它会根据该数据生成指标,这些数据可通过 Metrics API 获得。

Once you have installed the same, you can use the following command to get the metrics一旦你安装了相同的,你可以使用以下命令来获取指标

kubectl top pod <pod-name> -n <namespace> --containers

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取 CPU 利用率,Memory kubernetes 中的命名空间,pod,服务的利用率? - How to get CPU Utilization ,Memory Utilization of namespaces,pods ,services in kubernetes? Prometheus 查询以获取 kube.netes pod 中的 CPU 和 Memory 使用情况 - Prometheus queries to get CPU and Memory usage in kubernetes pods 如何获取 prometheus 中节点/pod 的 cpu 和 memory 使用情况? - How to get cpu and memory usage of nodes/pods in prometheus? Kubernetes Horizo​​ntal Pod Autoscaler 如何计算多容器 Pod 的 CPU 利用率? - How does Kubernetes Horizontal Pod Autoscaler calculate CPU Utilization for Multi Container Pods? 关于 kubenetes pod 的 CPU/内存利用率,主机的 top 命令显示了什么 - What does host's top command show about CPU/Memory utilization by kubenetes pods 无法看到 Pod 的 CPU 和内存利用率,并且缺少图表 Kubernetes 仪表板 - Unable able to see Pods CPU and Memory Utilization and graphs are missing Kubernetes dashboard Prometheus 查询仅获取处于运行状态的 Pod 的 CPU 和内存请求 - Prometheus queries to get the cpu and memory request of only pods which are in running state Kubernetes | 使用Prometheus监视HPA当前和目标CPU利用率 - Kubernetes | Monitor HPA's Current and Target CPU Utilization using Prometheus HPA 计算与 CPU 和 memory 利用率不匹配 - HPA calculation is not matching for cpu and memory utilization Argo Workflows pod 缺少 cpu/内存资源 - Argo Workflows pods missing cpu/memory resources
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM