grafana / kubernetes-app

A set of dashboards and panels for kubernetes.
https://grafana.com/plugins/grafana-kubernetes-app
Apache License 2.0
401 stars 149 forks source link

run Prometheus no node #6

Closed ppabloescobar closed 6 years ago

ppabloescobar commented 6 years ago

hello.

How to run a prometheus outside the node,there is a possibility.

jtlisi commented 6 years ago

You can run your Prometheus external to the the cluster. You can find more information on how to do that here

You will have to update the kubernetes sd config for prometheus to access your cluster.

More information on that can be found here: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

ppabloescobar commented 6 years ago

msg="Cannot create Kubernetes discovery" err="unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined"

ppabloescobar commented 6 years ago

scrape_configs:

jtlisi commented 6 years ago

@bernapa0 You are missing the api_server config.

Excerpt from the documentation linked in my first comment:


# The API server addresses. If left empty, Prometheus is assumed to run inside
# of the cluster and will discover API servers automatically and use the pod's
# CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
[ api_server: <host> ]

Because you are not setting the api_server config, the Prometheus is running as if it is in the cluster, which it is not.

prasad1204chinni commented 3 years ago

I am trying to replicate the setup. I am adding below config to my external prometheus server.

What iis the correct way of adding tls config or the bearer token.

If i use bearer token should i still give cert ? ALso could this be due to the default user being used ?

I get below error message.

level=error ts=2020-11-20T19:54:42.790Z caller=klog.go:94 component=k8s_client_runtime func=ErrorDepth msg="/app/discovery/kubernetes/kubernetes.go:263: Failed to list *v1.Pod: the server rejected our request for an unknown reason (get pods)"