Currently, the adapter uses http.DefaultClient to access Prometheus.
This means that it does support using TLS client certificates, custom
CA certificates, or token-base authentication, which are all common
setups when connecting to Prometheus behind an auth proxy.
This commit adds support for using a separate kubeconfig, or in-cluster
config, to configure auth when connecting to Prometheus.
Fixes #52
[directxman12: cleanups, spelling corrections, and slight refactor]
This allows setting a prefix on the labels used to determine which
resources a series belongs to. The prefix may be set using the
`--label-prefix` flag.
This updates the dependencies to be compatible with Kubernetes 1.8,
including the new custom.metrics.k8s.io/v1beta1 API group and the
corresponding custom-metrics-apiserver changes.
Currently, we fetch the discovery information once at the start of
of the adapter, and then never update it. This could prove problematic,
since other API servers might come only after the adapter is started up.
The boilerplate contains a periodically updating RESTMapper that solves
this issue by refreshing the discovery information at an interval (as
specified by a flag), so that we have a chance to fetch new resources.
This causes the Prometheus provider to take a stop channel as an
argument, which allows us to stop the lister (which keeps the series list
up to date) in the unit tests.