promote /metrics to genericapiserver

This commit is contained in:
deads2k
2016-10-31 09:53:57 -04:00
parent f56cbfa8d5
commit 912e6741b9
7 changed files with 21 additions and 15 deletions

View File

@@ -119,6 +119,9 @@ func (c *Config) Complete() completedConfig {
c.EndpointReconcilerConfig.Reconciler = NewMasterCountEndpointReconciler(c.GenericConfig.MasterCount, endpointClient)
}
// this has always been hardcoded true in the past
c.GenericConfig.EnableMetrics = true
return completedConfig{c}
}
@@ -195,7 +198,6 @@ func (c completedConfig) New() (*Master, error) {
if c.Tunneler != nil {
m.installTunneler(c.Tunneler, coreclient.NewForConfigOrDie(c.GenericConfig.LoopbackClientConfig).Nodes())
}
m.InstallGeneralEndpoints(c.Config)
return m, nil
}
@@ -227,16 +229,6 @@ func (m *Master) installTunneler(tunneler genericapiserver.Tunneler, nodeClient
}, func() float64 { return float64(tunneler.SecondsSinceSync()) })
}
// TODO this needs to be refactored so we have a way to add general health checks to genericapiserver
// TODO profiling should be generic
func (m *Master) InstallGeneralEndpoints(c *Config) {
if c.GenericConfig.EnableProfiling {
routes.MetricsWithReset{}.Install(m.GenericAPIServer.HandlerContainer)
} else {
routes.DefaultMetrics{}.Install(m.GenericAPIServer.HandlerContainer)
}
}
// InstallAPIs will install the APIs for the restStorageProviders if they are enabled.
func (m *Master) InstallAPIs(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter, restStorageProviders ...genericapiserver.RESTStorageProvider) {
apiGroupsInfo := []genericapiserver.APIGroupInfo{}