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.
k8s.io/custom-metrics-boilerplate was "renamed" to
"github.com/directxman12/custom-metrics-boilerplate". This updates all
references to point to the correct location.
This commit instruments prometheus query times by prometheus endpoint,
allowing us to see how quickly prometheus answers the queries that
back the custom-metrics API endpoints.
The initial functionality works. There's still a number of TODOs to
clean up, and some edge cases to work around, and some errors that could
be handled better.