我想按名称空间和容器监视我们的kubernetes集群上的资源(CPU,内存),您是否计划将其直接添加到stackdriver或hiw中,我可以这样做吗? 谢谢
我尝试在stackdriver中对指标进行分组,但缺少
答案 0 :(得分:0)
查看kube资源浏览器。它可以在命名空间级别列出cpu和内存使用情况。 跟随链接-> https://github.com/dpetzold/kube-resource-explorer
按照以下步骤
master $ go get github.com/dpetzold/kube-resource-explorer/cmd/kube-resource-explorer
master $ /opt/go/bin/kube-resource-explorer -namespace kube-system -reverse -sort MemReq
Namespace Name CpuReq CpuReq% CpuLimit CpuLimit% MemReq MemReq% MemLimit MemLimit%
--------- ---- ------ ------- -------- --------- ------ ------- -------- ---------
kube-system kube-scheduler-master/kube-scheduler 100m 2% 0m 0% 0Mi 0% 0Mi 0%
kube-system weave-net-4jb2j/weave 10m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system etcd-master/etcd 0m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system kube-apiserver-master/kube-apiserver 250m 6% 0m 0% 0Mi 0% 0Mi 0%
kube-system kube-controller-manager-master/kube-controller-manager 200m 5% 0m 0% 0Mi 0% 0Mi 0%
kube-system kube-proxy-7275r/kube-proxy 0m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system weave-net-4jb2j/weave-npc 10m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system kube-proxy-jklzm/kube-proxy 0m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system weave-net-s8zd8/weave 10m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system weave-net-s8zd8/weave-npc 10m 0% 0m 0% 0Mi 0% 0Mi 0%
kube-system coredns-78fcdf6894-fg9mv/coredns 100m 2% 0m 0% 70Mi 3% 170Mi 8%
kube-system coredns-78fcdf6894-mw6xc/coredns 100m 2% 0m 0% 70Mi 3% 170Mi 8%
--------- ---- ------ ------- -------- --------- ------ ------- -------- ---------
Total 790m/8000m 9% 0m/8000m 0% 140Mi/17515Mi 0% 340Mi/17515Mi 1%
master $
答案 1 :(得分:0)
Prometheus是Kubernetes经常使用的可选监视工具。如果您配置具有Prometheus支持的Stackdriver Kubernetes Engine监视,则可以从群集中导出在Prometheus数据模型中公开指标的服务,并在Stackdriver中将其显示为外部指标