前言
前面我们已经介绍了通过cadvisor和node-exporter来监控k8s集群容器和主机资源,今天向大家介绍一下kube-state-metrics对k8s集群的监控,那它主要是监控哪些内容的呢?我们先看一下官方的介绍
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
(See examples in the Metrics section below.) It is not focused on the health of the individual Kubernetes components, but rather on
the health of the various objects inside, such as deployments, nodes and pods.
从官方介绍中,我们可以知道,kube-state-metrics并不聚焦于k8s集群整体及相关组件的监控,而是更加关注deployments, nodes and pods等内部对象的状态。
例如:
- 现在计划了多少个副本?目前有多少可用?
- 有多少个 Pod 正在运行、已停止、已终止?
- 此 Pod 已重启多少次?
指标类型概览:
- CertificateSigningRequest Metrics
- ConfigMap Metrics
- CronJob Metrics
- DaemonSet Metrics
- Deployment Metrics
- Endpoint Metrics
- Horizontal Pod Autoscaler Metrics
- Ingress Met

本文介绍了kube-state-metrics在K8s集群监控中的作用,它专注于监控deployments、nodes和pods等对象的状态。通过示例展示了如何部署和配置kube-state-metrics,以及如何利用Prometheus抓取和展示相关metrics,如节点状态、副本数量、Pod运行状况等,以确保集群健康。
最低0.47元/天 解锁文章
1796

被折叠的 条评论
为什么被折叠?



