Closed ppabloescobar closed 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
msg="Cannot create Kubernetes discovery" err="unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined"
scrape_configs:
@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.
I am trying to replicate the setup. I am adding below config to my external prometheus server.
job_name: 'kubernetes-pods' scheme: https kubernetes_sd_configs:
role: endpoints api_server: 'url:443'
bearer_token:
relabel_configs:
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)"
hello.
How to run a prometheus outside the node,there is a possibility.