简体   繁体   English

如何在多主部署中监控 kube-apiserver?

[英]How to monitor kube-apiserver in multi-master deployment?

Saying for a K8s cluster with three master nodes, do I need to get metrics from each of the kube-apiserver running on all three nodes, or just one of them?对于具有三个主节点的 K8s 集群,我需要从所有三个节点上运行的每个 kube-apiserver 获取指标,还是只需要其中一个节点?

If only one of them, then do I need to worry about making sure always getting metric from the same node or let the dns decide which one to reach out to?如果只有其中一个,那么我是否需要担心确保始终从同一个节点获取指标,或者让 dns 决定联系哪一个?

Is there a potential risk that the counter metrics on each nodes accumulate at a different rate and result in decrease in counters if pulling metrics from a random node each time?如果每次从随机节点中提取指标,是否存在每个节点上的计数器指标以不同的速率累积并导致计数器减少的潜在风险?

You should monitor each of the API Server in all the three master nodes separately because if there is an issue in one of those you should probably remove it from the loadbalancer in-front of the API Servers.您应该分别监控所有三个主节点中的每个 API 服务器,因为如果其中一个出现问题,您可能应该将其从 API 服务器前面的负载均衡器中删除。

You could use prometheus for monitoring.您可以使用 prometheus 进行监控。 Kubernetes API Server exposes metrics in prometheus format already. Kubernetes API 服务器已经以普罗米修斯格式公开了指标。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM