Fix k8s target discovery when not running inside k8s
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 <9e8f1a26fbf401b045347f083556ffd7c0b25a58@nilsding.org>

prometheus/prometheus,keegancsmith/prometheus,keegancsmith/prometheus,prometheus/prometheus,keegancsmith/prometheus,keegancsmith/prometheus,prometheus/prometheus,keegancsmith/prometheus,prometheus/prometheus,prometheus/prometheus