prometheus运算符-启用对所有名称空间中所有内容的监视 [英] prometheus operator - enable monitoring for everything in all namespaces
问题描述
我想通过prometheus-operator监视在命名空间development
和production
的Kubernetes集群上运行的几个应用程序.
I want to monitor a couple applications running on a Kubernetes cluster in namespaces named development
and production
through prometheus-operator.
使用的安装命令(根据 Github )是:
Installation command used (as per Github) is:
helm install prometheus-operator stable/prometheus-operator -n production --set prometheusOperator.enabled=true,prometheus.service.type=NodePort,prometheusOperator.service.type=NodePort,alertmanager.service.type=NodePort,grafana.service.type=NodePort,grafana.service.nodePort=30906
我需要向上述命令添加哪些参数,以使prometheus-operator
发现并监视在所有namespaces
中运行的所有应用程序/服务/吊舱?
What parameters do I need to add to above command to have prometheus-operator
discover and monitor all apps/services/pods running in all namespaces
?
这样,Service Discovery
仅显示一些与prometheus-operator
相关的services
,而不显示我在'生产'名称空间中运行的应用程序,即使prometheus-operator
已安装在同一namespace
中.
With this, Service Discovery
only shows some prometheus-operator
related services
, but not the app that I am running within 'production' namespace even though prometheus-operator
is installed in the same namespace
.
我想念什么吗?
注意-我正在使用同一用户(使用$HOME/.kube/config file
)执行所有操作,因此我认为权限不是问题.
Note - Am running performing all actions using the same user (which uses the $HOME/.kube/config file
), so I assume permissions are not an issue.
kubectl版本-v1.17.3 头盔版本-3.1.2
kubectl version - v1.17.3 helm version - 3.1.2
P.S.在不同的论坛上有很多关于此的文章,但是仍然没有找到简单直接的答案.
P.S. There are numerous articles on this on different forums, but am still not finding simple and direct answers for this.
推荐答案
I used values.yaml from https://github.com/helm/charts/blob/master/stable/prometheus-operator/values.yaml, modified parameters *NilUsesHelmValues to False and it seems to work fine with that. helm install prometheus-operator stable/prometheus-operator -n monitoring -f values.yaml
另外,例如 https://stackoverflow.com/users/7889479/anish-kumar-mourya说,服务确实会显示在Grafana仪表板上,即使它们未出现在Prometheus UI中的服务发现"或目标"下.
Also, like https://stackoverflow.com/users/7889479/anish-kumar-mourya stated, the services do show in Grafana dashboard even though they dont appear in Prometheus UI under Service Discovery or Targets.
希望这对其他像我这样的新手有所帮助.
Hope this helps other newbies like me.
这篇关于prometheus运算符-启用对所有名称空间中所有内容的监视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!