prometheus/discovery/kubernetes
Georg Gadinger 4663f814d6 Fix k8s target discovery when not running inside k8s
When using Kubernetes service discovery on a Prometheus instance that's
not running inside Kubernetes, the creation of the service discovery
fails with a "no such file or directory" error as the special
`/var/run/secrets/kubernetes.io/serviceaccount/namespace` file is not
there.  This commit moves the code that reads this file into the
if-branch where no `APIServer.URL` is given (that one basically makes
Prometheus assume it is running inside of a Kubernetes cluster).

Signed-off-by: Georg Gadinger <nilsding@nilsding.org>
2022-02-01 10:20:03 +01:00
..
client_metrics.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
endpoints.go Fix imports formatting 2021-11-02 19:52:34 +01:00
endpoints_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00
endpointslice.go discovery/kubernetes: issue overcapacity warning for endpoint rather than endpointslice 2021-10-08 23:17:04 +03:00
endpointslice_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00
ingress.go kubernetes ingress: adjust comment style 2021-08-30 22:34:24 +02:00
ingress_adaptor.go Kubernetes SD: Fix golint issue 2021-08-24 17:30:33 +09:00
ingress_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00
kubernetes.go Fix k8s target discovery when not running inside k8s 2022-02-01 10:20:03 +01:00
kubernetes_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00
node.go Kubernetes service discovery: add provider ID label (#9603) 2021-12-06 22:27:11 +01:00
node_test.go Kubernetes service discovery: add provider ID label (#9603) 2021-12-06 22:27:11 +01:00
pod.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
pod_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00
service.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
service_test.go Implement target discovery in own k8s namespace 2021-12-14 13:41:38 +01:00